gulp-cond
A ternary operator for Gulp.
Usage
First, install gulp-cond
as a development dependency:
npm install --save-dev gulp-cond
Then, use it to conditionnaly pipe plugins in your gulpfile.js
:
var cond = ;var prod = gulpenvprod; // Imagesgulp;
Alternatively, you can provide plugin functions instead of streams to instanciate streams only when needed :
var cond = ;var prod = gulpenvprod; // Imagesgulp;
API
cond(condition, expr1, expr2)
condition
Type: Boolean
or Function
Required. A value or a function providing a value. If the value is truthy, expr1 will be used, else, expr2 will be use if provided.
expr1
Type: Stream
or Function
Required. A stream or a function providing a stream.
expr2
Type: Stream
or Function
Default value: Stream.PassThrough
A stream or a function providing a stream.
Stats
Contributing / Issues
You may want to contribute to this project, pull requests are welcome if you accept to publish under the MIT licence.