lib/kona/watch.js
function watch(path, cb) {
    debug('watching %s for changes', path);

    var options = {ignoreInitial: true, persistent: true},
        watcher = chokidar.watch(path, options);

    watcher.on('change', function(path, stat) {

      /* istanbul ignore next */
      debug(format("%s changed", path));

      /* istanbul ignore next */
      cb.call(this, path, stat);

    }.bind(this));

    return watcher;
  }
function watch(path, cb) {
    debug('watching %s for changes', path);

    var options = {ignoreInitial: true, persistent: true},
        watcher = chokidar.watch(path, options);

    watcher.on('change', function(path, stat) {

      /* istanbul ignore next */
      debug(format("%s changed", path));

      /* istanbul ignore next */
      cb.call(this, path, stat);

    }.bind(this));

    return watcher;
  }
function watch ( path , cb ) { debug ( 'watching %s for changes' , path ) ; var options = { ignoreInitial : true , persistent : true } , watcher = chokidar . watch ( path , options ) ; watcher . on ( 'change' , function ( path , stat ) { /* istanbul ignore next */ debug ( format ( "%s changed" , path ) ) ; /* istanbul ignore next */ cb . call ( this , path , stat ) ; } . bind ( this ) ) ; return watcher ; }
setup a chokidar persistent watcher on a dir or file and call
the callback on `change` event

@param  {String}   path directory (recursive) or file path to watch
@param  {Function} cb   callback to call on `change` event
@return {choikdar.watcher}        the watcher instance created
setup a chokidar persistent watcher on a dir or file and call the callback on change event