Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
55ac57a122 | |||
7da57901dd | |||
12500a0900 | |||
36371d9469 | |||
4e9874a639 | |||
e55e30bdb3 | |||
44aed02dd3 | |||
8d8d7e7ff4 | |||
57c90ca504 | |||
02b73f8bf8 |
@ -1,16 +1,16 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "4.1"
|
- '4.1'
|
||||||
before_install:
|
before_install:
|
||||||
- npm install -g tsd
|
- npm install -g tsd
|
||||||
deploy:
|
deploy:
|
||||||
provider: npm
|
provider: npm
|
||||||
email: npm@smart-coordination.com
|
email: npm@smart-coordination.com
|
||||||
api_key:
|
api_key:
|
||||||
secure: y7l1JyBDihAYxbqfuPAUXJfY+PC7RSSCkAtXtBIjPA6wytSBnz55te/Vdy8RFgVty6O/k4hHzrhgUJMSoWKmPuGQ5bMBgkyV9OI5PPp4uEUyy5UdcJZv3cZYpGGDRjLjCHP4pF7AHdRcDUMEiE5ZrDtmUH1SBLoRswieO0TKsiMr3u45yR6rHFoPnnw1YlatoAPpiuP3SLnCrIjQeSOS7y9SL6PpakiquJNtpseVOr60sp39L6vLAeqJ7xTjjNJk23LF/60lfiKtM7QFg9qqE7cxFUWJs7Zmgfg4/hGcU9XRfDfZQgSNntcdFczPejO5juv2KOb1tzH7EhXrWlcF1yd70RBdJbcOn7O6ctHjMCGrCSn6IQPzcNWNErFELfMLsjVQUxbfHSc0iA1JxcYWeXUivrStwVOa9ufuG2KZCQZyEjra3zPdCu9yrE30c/mTace7eJXPYTsNn2tmxvTnFoTWmeQ0xL9Iyz9zceADpxjYJoJ8r4XMDWxWga5G9OPaqCINHxjKhOX0C36YEjYTaeNMNHv6F6BPLdKwQ9SmklMtcyC312nJsXwKy+KYJSoY6WqMef9Zk3ez0o09W0UkSr0qiQkyYCoNm8b1L7VrYuccPH24GE0fn8QMWmeE5TBThYbEIdt6NBoYCDeocflUm5KBrImFGo1peeYS1aQnpoQ=
|
secure: 3RdzAcS9d6sLJs3tHM2uCVU2wV2NsKiLiYWue98DevgijIqTFDHtYuoP29p7fbB4SV87JRbTK1y41QM2u/CCjnbB+mrAUg/Pn08dTibmzi9liom67sLczIPD4eZeMznXPRaddESQdzqrtQfc/6P+1JQO7XWexLNebgYtMrUzYcOrHPWf/Uktk2cKiYfrO8piSR+HOFh2rzC5HjVZ/7fKDIa9bqTlBETkNc7s2NgB++jKRF9LNMVGI/9EmxjBzSSE1juOz26Ahp4+/+P3Lc5LngnTFOYsPoW5iWNY+AQltZxhu9K+rrtfn90rmQDnO7RCGO5yZgMS2+0UjJedwV+4ancU3nzoNmiuoIL7DjQ7NQlt0QKMmIqZuBFBc3tdxqotxNoJDk8/Ui0yfHWzJz0Fd22OI+VdTWNH1y5Vyywsql6wwkl2+Da1WhZf/Mn2gPgLPI0lssPTIl/u3Bey+167tZ3HvX0yqlvPO/JbqK02+5VrRBaV67vT00DG+dh4nnwqcX14Umx2a3JHt3tSGkDnDKpsLbvqjhPhkMRsCIloju+wMnyKjtScMZW+2FeO2n4PgbjNhF+5SG8pDmTS8p0Vy7iohUOiGIJty7K/1r6sQ1FNluhO5Ol3mBDs6wjg6S5QCSNL9eylpV52FV0UX4cRCijmzso+n48I2BbSwjghTB8=
|
||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
repo: pushrocks/gulp-bootstrap
|
repo: pushrocks/smartfile
|
||||||
notifications:
|
notifications:
|
||||||
slack:
|
slack:
|
||||||
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI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FLF7oiQ=
|
||||||
|
16
index.js
16
index.js
@ -1,10 +1,12 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var through = require("through2");
|
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
module.exports = function (jadeTemplate, mojo) {
|
var fs = require("fs");
|
||||||
if (mojo === void 0) { mojo = undefined; }
|
var smartfile = {
|
||||||
return through.obj(function (file, enc, cb) {
|
//read File to string
|
||||||
//run callback function to signal end of plugin process.
|
readFileToString: function (filePath) {
|
||||||
return cb(null, file);
|
var fileString;
|
||||||
});
|
fileString = fs.readFileSync(filePath, "utf8");
|
||||||
|
return fileString;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
module.exports = smartfile;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "smartfile",
|
"name": "smartfile",
|
||||||
"version": "0.0.1",
|
"version": "0.0.6",
|
||||||
"description": "offers smart ways to work with files in nodejs",
|
"description": "offers smart ways to work with files in nodejs",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(cd ts/compile && node compile.js)",
|
"test": "(cd ts/compile && node compile.js) && (node test.js)",
|
||||||
"reinstall": "(rm -r node_modules && npm install)",
|
"reinstall": "(rm -r node_modules && npm install)",
|
||||||
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
||||||
"startdev": "(git checkout master && git pull origin master)"
|
"startdev": "(git checkout master && git pull origin master)"
|
||||||
@ -24,10 +24,11 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/smartfile",
|
"homepage": "https://github.com/pushrocks/smartfile",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pushrocks": "^1.0.18"
|
"beautylog": "^1.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "3.9.0",
|
"gulp": "3.9.0",
|
||||||
"gulp-typescript": "2.9.2"
|
"gulp-typescript": "2.9.2",
|
||||||
|
"pushrocks": "^1.0.19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
test.js
Normal file
4
test.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
|
var smartfile = require("./index.js");
|
||||||
|
var beautylog = require("beautylog")("os");
|
||||||
|
beautylog.info(smartfile.readFileToString("./test/mytest.txt"));
|
1
test/mytest.txt
Normal file
1
test/mytest.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
This is some test text stored in ./test/mytest.txt -> If this is displayed when running "npm test", then the test has succeeded.
|
@ -12,7 +12,16 @@ gulp.task('compileTS', function() {
|
|||||||
return stream;
|
return stream;
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('default',['compileTS'], function() {
|
gulp.task('compileTestTS', function() {
|
||||||
|
var stream = gulp.src('../test.ts')
|
||||||
|
.pipe(gulpTypescript({
|
||||||
|
out: "test.js"
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest("../../"));
|
||||||
|
return stream;
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('default',['compileTS','compileTestTS'], function() {
|
||||||
pr.beautylog.success('Typescript compiled');
|
pr.beautylog.success('Typescript compiled');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
19
ts/index.ts
19
ts/index.ts
@ -1,12 +1,15 @@
|
|||||||
/// <reference path="typings/tsd.d.ts" />
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
var through = require("through2");
|
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
|
var fs = require("fs");
|
||||||
|
|
||||||
module.exports = (jadeTemplate,mojo = undefined) => {
|
var smartfile:any = {
|
||||||
|
//read File to string
|
||||||
return through.obj((file, enc, cb) => {
|
readFileToString: (filePath) => {
|
||||||
|
var fileString;
|
||||||
//run callback function to signal end of plugin process.
|
fileString = fs.readFileSync(filePath, "utf8");
|
||||||
return cb(null, file);
|
return fileString;
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = smartfile;
|
||||||
|
4
ts/test.ts
Normal file
4
ts/test.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference path="typings/tsd.d.ts" />
|
||||||
|
var smartfile = require("./index.js");
|
||||||
|
var beautylog = require("beautylog")("os");
|
||||||
|
beautylog.info(smartfile.readFileToString("./test/mytest.txt"));
|
Reference in New Issue
Block a user