🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

gulp-runner

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-runner

Programmatic API for running gulp tasks.

1.1.0
latest
Source
npm
Version published
Weekly downloads
1.6K
15.68%
Maintainers
1
Weekly downloads
 
Created
Source

Gulp Runner

Simple module for running gulp tasks programattically, since gulp.run is deprecated.

Usage

var GulpRunner = require('gulp-runner');

// Runs path.resolve, but probably a good idea 
// to hand this a full filepath
var gulp = new GulpRunner('gulpfile.js');

Simple Callback

gulp.run('task', function(err) {
  // complete if no error
})

CLI Options

/* optional cli arguments (camelcased) */
var opts = {
  require: ['coffeescript', 'some-lib'],
  tasksSimple: true,
  production: true   // also accepts arbitrary flags 
                     // for use within your tasks
};

// equivalent of calling 
// gulp task1 task2 --require 'coffeescript' --require 'some-lib' --tasks-simple --production
gulp.run(['task1', 'task2'], opts, function(err) {
  // complete!
})

Event Emitter interface

Note: You can call run() many times with the same instance, but there will be no distinction between events. Best to use a new instance, or just pass an array of tasks.

// Need to bind your events before calling run()
gulp.on('start', function() {
  console.log('gulp starting...')
})

gulp.on('complete', function() {
  console.log('complete!')
})

gulp.on('log', function(data: Buffer) {
  // console.log(data.toString())
  // works better to 
  process.stdout.write(data);
})

gulp.on('error', function(err: Buffer) {
  process.stderr.write(err);
})

gulp.run('default')

FAQs

Package last updated on 27 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts