gulp-until
v0.1.3
Published
Wait for an evaluation function to become true in your gulp pipe.
Downloads
6
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 returntrue
orfalse
.
Installation
$ npm install gulp-until --save-dev
$ yarn add gulp-until --dev
Example Usage
Either pass a function directly:
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-util a custom time to wait between checks.Default: 100
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));