0.4.0 • Published 10 years ago

mutiny v0.4.0

Weekly downloads
5
License
MIT
Repository
github
Last release
10 years ago

mutiny build status

Recursively mutates files in a given directory.

var through = require('through2');
var mutiny = require('mutiny');

function toUpper(file, content) {
  return through(
    function (chunk, enc, cb) {
      this.push(chunk.toUpperCase());
      cb();
    }
  )
}

var readdirpOpts = { root: __dirname + '/root' };
mutiny({ outdir: __dirname + '/out', transform: [ toUpper ]}, readdirpOpts)
  .on('error', console.error)
  .on('data', function (d) { console.log('\nProcessed:\n', d); })

transform example

# assuming trim-leading is a transform installed as a node_module
mutiny ./root -t ./local-transform/toUpper.js -t trim-leading -o ./out 

bin example

Installation

npm install mutiny

API

generated with docme

More Examples

Please find more examples in the examples directory and consult the tests

License

MIT