0.2.1 • Published 9 years ago

watchbuild v0.2.1

Weekly downloads
3
License
MIT
Repository
-
Last release
9 years ago

watchbuild

Build Status

Watch files and transform them with streams.

var wb = require('watchbuild');
var marked = require('marked');
var through = require('through2');

// convert 'test.md' to html and write the result to 'test.html'
// whenever 'test.md' it changes
wb({ './test.md': './test.html' }, function () { return marked; });

// also supports streams
wb({ './foo.md': './foo.html' }, function () {
  return through(function (buf, _, next) {
    this.push(marked(buf.toString()));
    next();
  });
});

// and globs
wb({ './*bar.md': 'bar.html', './*foo.md': 'foo.html' }, function () { return marked; });

Installation

$ npm install watchbuild

API

watchbuild(files, transform)

files is an object mapping glob patterns to output paths. If a file is mapped to undefined or null, it isn't written anywhere.

transform can return a transform stream or a function that takes and returns a string.

License

MIT. See ./LICENSE for details.

TODO

  • more tests
0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.21

10 years ago

0.0.2

10 years ago

0.0.11

10 years ago

0.0.1

10 years ago