kernel/assist.js
function tryWatch(target, callback) {
  if (!target) {
    return logger.halt('invalid watch target')
  }
  if (!callback || typeof callback !== 'function') {
    return logger.halt('invalid watch callback')
  }

  return fs.watch(
    target, { persistent: true, recursive: true},
    function (e, file) {
      // todo: exact watch
      callback(e, file)
    }
  )
}
function tryWatch(target, callback) {
  if (!target) {
    return logger.halt('invalid watch target')
  }
  if (!callback || typeof callback !== 'function') {
    return logger.halt('invalid watch callback')
  }

  return fs.watch(
    target, { persistent: true, recursive: true},
    function (e, file) {
      // todo: exact watch
      callback(e, file)
    }
  )
}
function tryWatch ( target , callback ) { if ( ! target ) { return logger . halt ( 'invalid watch target' ) } if ( ! callback || typeof callback !== 'function' ) { return logger . halt ( 'invalid watch callback' ) } return fs . watch ( target , { persistent : true , recursive : true } , function ( e , file ) { // todo: exact watch callback ( e , file ) } ) }
try to watch with custom callback

@param  {String} target
@param  {Function} callback
@return {Object} fs.Watcher
try to watch with custom callback