lib-polygen
v0.0.0
Published
Polymorphic Generator
Downloads
3
Readme
lib-polygen
install
npm install --save lib-polygen
usage
var fs = require('fs');
var PolyGenerator = require('lib-polygen').PolyGenerator;
var pg = new PolyGenerator();
pg.addSymbol(':stdout', function () {
return process.stdout;
});
pg.addSymbol(':stderr', function () {
return process.stderr;
})
pg.setDefault(function (file) {
return fs.createWriteStream(file);
});
pg.generate(':stdout').write('hello\n');
pg.generate(':stderr').write('goodbye\n');