How to use watch

Comprehensive watch code examples:

How to use watch.createMonitor:

95
96
97
98
99
100
101
102
103
104
 * Watch javascript source files.
 */
function watchFiles(srcDirectory, distDirectory) {
  var transpiler = javascripts.getTranspiler(srcDirectory, distDirectory, isAllowed, babelOptions, browserifyOptions);

  watch.createMonitor(srcDirectory, watchOptions, function(monitor) {
    monitor.on('created', function(filename, stats) {
      if (isAllowed(filename))
        transpiler.transpile(filename, []);
    });