How to use the vinyl-fs.watch function in vinyl-fs

To help you get started, we’ve selected a few vinyl-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github assemble / assemble / lib / extensions / vinyl-fs.js View on Github external
Assemble.prototype.watch = function(glob, options, fn) {
    if (typeof options === 'function' || Array.isArray(options)) {
      fn = options;
      options = null;
    }

    // Tasks to watch
    if (Array.isArray(fn)) {
      return fs.watch(glob, options, function() {
        this.start.apply(this, fn);
      }.bind(this));
    }
    return fs.watch(glob, options, fn);
  };
github legomushroom / resize / node_modules / gulp / index.js View on Github external
Gulp.prototype.watch = function (glob, opt, fn) {
  if (typeof opt === 'function' || Array.isArray(opt)) {
    fn = opt;
    opt = null;
  }

  // array of tasks given
  if (Array.isArray(fn)) {
    return vfs.watch(glob, opt, function () {
      this.start.apply(this, fn);
    }.bind(this));
  }

  return vfs.watch(glob, opt, fn);
};
github jonschlinkert / extract-comments / fixtures / assemble.js View on Github external
Assemble.prototype.watch = function(glob, options, fn) {
  if (typeof options === 'function' || Array.isArray(options)) {
    fn = options;
    options = null;
  }

  // Tasks to watch
  if (Array.isArray(fn)) {
    return fs.watch(glob, options, function() {
      this.start.apply(this, fn);
    }.bind(this));
  }
  return fs.watch(glob, options, fn);
};
github assemble / assemble / lib / extensions / vinyl-fs.js View on Github external
Assemble.prototype.watch = function(glob, options, fn) {
    if (typeof options === 'function' || Array.isArray(options)) {
      fn = options;
      options = null;
    }

    // Tasks to watch
    if (Array.isArray(fn)) {
      return fs.watch(glob, options, function() {
        this.start.apply(this, fn);
      }.bind(this));
    }
    return fs.watch(glob, options, fn);
  };
github assemble / assemble / lib / index.js View on Github external
Assemble.prototype.watch = function(glob, opts, fn) {
  if (Array.isArray(opts) || typeof opts === 'function') {
    fn = opts; opts = null;
  }

  if (Array.isArray(fn)) {
    return vfs.watch(glob, opts, function () {
      this.start.apply(this, fn);
    }.bind(this));
  }

  return vfs.watch(glob, opts, fn);
};
github assemble / assemble / lib / assemble.js View on Github external
Assemble.prototype.watch = function(glob, opts, fn) {
  if (Array.isArray(opts) || typeof opts === 'function') {
    fn = opts; opts = null;
  }

  if (Array.isArray(fn)) {
    return vfs.watch(glob, opts, function () {
      this.start.apply(this, fn);
    }.bind(this));
  }

  return vfs.watch(glob, opts, fn);
};
github verbose / verb / lib / verb.js View on Github external
Verb.prototype.watch = function (glob, opts, fn) {
  if (Array.isArray(opts) || typeof opts === 'function') {
    fn = opts;
    opts = null;
  }

  if (Array.isArray(fn)) {
    return vfs.watch(glob, opts, function () {
      this.start.apply(this, fn);
    }.bind(this));
  }
  return vfs.watch(glob, opts, fn);
};
github sprity / sprity / bin / cli.js View on Github external
.option('style-indent-size', {
    default: 2,
    help: 'Number of characters used for indentation of styles'
  })
  .script('sprity')
  .parse();

opts.logger = log;
opts.cli = true;

if (opts.watch) {
  if (opts['no-sort']) {
    opts.sort = false;
  }
  log('Watching for file changes ...');
  fs.watch(opts.src, function () {
    sprite.create(opts, function () {
      log.success('Sprite created in ' + opts.out);
    });
  });
}
else {
  if (opts['no-sort']) {
    opts.sort = false;
  }

  sprite.create(opts, function () {
    log.success('Sprite created in ' + opts.out);
  });
}
github verbose / verb / lib / verb.js View on Github external
Verb.prototype.watch = function (glob, opts, fn) {
  if (Array.isArray(opts) || typeof opts === 'function') {
    fn = opts;
    opts = null;
  }

  if (Array.isArray(fn)) {
    return vfs.watch(glob, opts, function () {
      this.start.apply(this, fn);
    }.bind(this));
  }
  return vfs.watch(glob, opts, fn);
};
github stringparser / gulp-runtime / lib / proto.js View on Github external
if(cb || opt.reload){
    opt.onHandleEnd = function(next, ev){
      if(this instanceof Stack && (this.queue || this.host)){return ;}
      if(util.shouldReloadFile(opt, ev)){
        delete require.cache[ev.path];
        require(ev.path);
      }
      if(cb){ cb(ev, opt); }
    };
  }

  var tasks = util.type(opt.tasks);
  if(tasks.string || tasks.array){
    tasks = tasks.string || tasks.array.join(' ');
    return vinylFS.watch(glob, this.stack(tasks, opt));
  }

  return vinylFS.watch(glob, opt, opt.onHandleEnd);
};

vinyl-fs

Vinyl adapter for the file system.

MIT
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis