@whitneyit/series

1.1.2 • Public • Published

Series

Run gulp tasks in series.

Installation

This package is scoped and requires npm 2.0.0 or above.

You can install series using npm.

$ npm install --save-dev @whitneyit/series

Getting started

First, read the official guide on running tasks in series. If this still does not address your use case then this package may be able to help.

Some good use cases for this plugin are if you are spinning up multiple instances of phantomjs or some other potentially memory intensive task. If this doesn't sound like what you're doing then this package is probably not for you.

Once installed, create a gulpfile.js and define some tasks.

// gulpfile.js

var gulp   = require('gulp');
var casper = require('gulp-casperjs');
var karma  = require('karma').serve;
var series = require('@whitneyit/series')(gulp);

gulp.task('test:unit', function (done) {
    karma.start({
        configFile: __dirname + '/karma.conf.js',
        singleRun: true
    }, done);
});

gulp.task('test:ui', function () {
    gulp.src(['tests/**/*.js'])
        .pipe(casper());
});

gulp.task('test', series(['test:unit', 'test:ui']));

By structuring the gulpfile.js like this it allows you to call each child task without having to have the tasks depend on each other.

If you made the test:ui task depend upon the test:unit task, every time you ran gulp test:ui you will run your unit tests as well. This package alleviates that annoyance.

Package Sidebar

Install

npm i @whitneyit/series

Weekly Downloads

0

Version

1.1.2

License

MIT

Last publish

Collaborators

  • whitneyit