Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabiandev/gulp-until

Wait for a condition before moving on to the next task.
https://github.com/fabiandev/gulp-until

gulp javascript pipe

Last synced: about 2 months ago
JSON representation

Wait for a condition before moving on to the next task.

Awesome Lists containing this project

README

        

# gulp-until

This package evaluates a function until it returns `true` to go to the next pipe.

> A true-ish return value like `1` or `{}` would *not* trigger the next pipe.
> The function has to explicitly return `true` or `false`.

# Installation

```sh
$ npm install gulp-until --save-dev
```

```sh
$ yarn add gulp-until --dev
```

# Example Usage

Either pass a function directly:

```js
import until from 'gulp-until';

return gulp.src(config.src)
.pipe(until(() => {
// Once this function returns true for the first time,
// the next pipe is executed.
}))
.pipe(gulp.dest(config.dest));
```
> The example above uses the ES6 syntax.

Or additionally give gulp-until a custom time to wait between checks.
`Default: 100`

```js
var until = require('gulp-until');

return gulp.src(config.src)
.pipe(until({
wait: 800, // ms to wait between checks.
check: function() {
// Again the evaluation function.
}
}))
.pipe(gulp.dest(config.dest));
```