JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q74343F
  • License MIT

Make a new callback to run input callbacks in sequence

Package Exports

  • callback-sequence

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (callback-sequence) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

callback-sequence

Make a new callback to run input callbacks in sequence

It is meant to make it easy to construct a gulp task from a sequence of callbacks.

Usage

var sequence = require('callback-sequence');
var Readable = require('stream').Readable;
var gulp = require('gulp');

gulp.task('publish', sequence(
  read, lint, warn, bump
));

function lint() {
}

function warn(cb) {
  process.nextTick(cb);
}

function bump() {
  return Promise.resolve();
}

function read() {
  var s = Readable();
  s.push(null);
  return s;
}

cb = sequence()

Each argument passed in could be a gulp task callback, or an array containing such elements.

sequence will create a callback to run all those specified tasks in appearance order. cb has signature cb(done), and done is called after those tasks finish, with an error object or null.

sequence.run(callbacks, done)

callbacks

Type: Array

An array of gulp task callbacks.

done, if specified, is called after all tasks finish, with an error object or null.