Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/fabiandev/gulp-until
- Owner: fabiandev
- License: mit
- Created: 2016-11-16T16:10:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T13:43:59.000Z (over 7 years ago)
- Last Synced: 2024-11-07T18:32:12.084Z (3 months ago)
- Topics: gulp, javascript, pipe
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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));
```