# gulp-sequence

> Run a series of gulp tasks in order.

Latest version **1.0.0** (published 2017-12-30) · 0 weekly downloads

## Install

```sh
npm install gulp-sequence
pnpm add gulp-sequence
yarn add gulp-sequence
bun add gulp-sequence
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-12-30 |
| First published | 2014-10-13 |
| Weekly downloads | 0 |
| TypeScript types | separate (@types/gulp-sequence) |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 193 |
| Maintainers | zensh |
| Keywords | gulpplugin, sequence, sync, thunk, thunks, flow |

## Links

- npm: https://www.npmjs.com/package/gulp-sequence
- Repository: https://github.com/teambition/gulp-sequence
- Issues: https://github.com/teambition/gulp-sequence/issues
- npm.io page: https://npm.io/package/gulp-sequence

## Dependencies (1)

- [thunks](https://npm.io/package/thunks.md) ^4.9.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-12-30
- 0.4.6 — 2016-08-29
- 0.4.5 — 2016-02-15
- 0.4.4 — 2015-12-25
- 0.4.3 — 2015-12-19
- 0.4.2 — 2015-12-19
- 0.4.1 — 2015-08-20
- 0.4.0 — 2015-07-10
- 0.3.2 — 2015-02-09
- 0.3.1 — 2014-11-22
- 0.3.0 — 2014-11-13
- 0.2.1 — 2014-10-15
- 0.2.0 — 2014-10-14
- 0.1.2 — 2014-10-14
- 0.1.1 — 2014-10-13
- … 1 more at https://npm.io/package/gulp-sequence/versions

## README

gulp-sequence
====
Run a series of gulp tasks in order.

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]

## Install

Install with [npm](https://npmjs.org/package/gulp-sequence)

```
npm install --save-dev gulp-sequence
```


## Usage

```js
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence')

gulp.task('a', function (cb) {
  //... cb()
})

gulp.task('b', function (cb) {
  //... cb()
})

gulp.task('c', function (cb) {
  //... cb()
})

gulp.task('d', function (cb) {
  //... cb()
})

gulp.task('e', function (cb) {
  //... cb()
})

gulp.task('f', function () {
  // return stream
  return gulp.src('*.js')
})

// usage 1, recommend
// 1. run 'a', 'b' in parallel;
// 2. run 'c' after 'a' and 'b';
// 3. run 'd', 'e' in parallel after 'c';
// 3. run 'f' after 'd' and 'e'.
gulp.task('sequence-1', gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f'))

// usage 2
gulp.task('sequence-2', function (cb) {
  gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f', cb)
})

// usage 3
gulp.task('sequence-3', function (cb) {
  gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f')(cb)
})

gulp.task('gulp-sequence', gulpSequence('sequence-1', 'sequence-2', 'sequence-3'))
```

**with `gulp.watch`**:
```js
gulp.watch('src/**/*.js', function (event) {
  gulpSequence('a', 'b')(function (err) {
    if (err) console.log(err)
  })
})
```

## API

```js
var gulpSequence = require('gulp-sequence')
```

### gulpSequence('subtask1', 'subtask2',...[, callback])
return a [thunk](https://github.com/teambition/thunks) function.

```js
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence')

gulp.task('test', gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f'))
```

### gulpSequence.use(gulp)
return a new gulpSequence function with the gulp. If you have some errors such as "task xxx is not defined", this will resolve it.

```js
var gulp = require('gulp')
var gulpSequence = require('gulp-sequence').use(gulp)

gulp.task('test', gulpSequence(['a', 'b'], 'c', ['d', 'e'], 'f'))
```

## License

MIT © [Teambition](https://www.teambition.com)

[npm-url]: https://npmjs.org/package/gulp-sequence
[npm-image]: http://img.shields.io/npm/v/gulp-sequence.svg

[travis-url]: https://travis-ci.org/teambition/gulp-sequence
[travis-image]: http://img.shields.io/travis/teambition/gulp-sequence.svg

[downloads-url]: https://npmjs.org/package/gulp-sequence
[downloads-image]: http://img.shields.io/npm/dm/gulp-sequence.svg?style=flat-square

---
_Source: https://npm.io/package/gulp-sequence · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
