0.1.0 • Published 13 years ago
exportify v0.1.0
exportify
Generate require()-able javascript files from non-javascript files.
example
command-line usage
$ for f in files/*.txt; do echo $f:; cat <(echo -n ' ') $f; done
files/a.txt:
beep
files/b.txt:
boop$ ../bin/cmd.js -v files/*.txt
files/a.txt
files/b.txt$ for f in files/*.js; do echo $f:; cat <(echo -n ' ') $f; done
files/a.txt.js:
module.exports="beep\n"
files/b.txt.js:
module.exports="boop\n"api
var exportify = require('exportify');
var ex = exportify([ 'a.txt', 'b.txt' ]);
ex.on('export', function (file) {
console.log('exported ' + file);
});
ex.on('end', function () {
console.log('all done');
});$ node ex.js
exported files/a.txt
exported files/b.txt
all doneusage
Usage: exportify OPTIONS [files]
OPTIONS:
-h, --help show this message
-e, --ext only exportify files with this extension
-v, --verbose log a message for every file writtenmethods
var exportify = require('exportify')exportify(files, opts={})
For each file in the files array,
generate a file + '.js' file that exports the file's contents.
Optionally, if opts.ext is set, only include files in the files list with
the opts.ext extension.
install
With npm, to get the command-line tool do:
npm install -g exportifyand to install the library do:
npm install exportifylicense
MIT
