
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Ternary operator for Gulp.
First, install gulp-cond
as a development dependency:
npm install --save-dev gulp-cond
Then, use it to conditionally pipe plugins in your gulpfile.js
:
import cond from 'gulp-cond';
var prod = gulp.env.prod;
// Images
gulp.task('build_images', function() {
gulp.src('assets/images/**/*.svg')
.pipe(cond(prod,
gSvgmin(options), // minify SVG images under production
gWatch().pipe(gLivereload(server))) // use live reload in dev mode
)
.pipe(gulp.dest('www/images'))
});
Alternatively, you can provide plugin functions instead of streams to instantiate streams only when needed :
import cond from 'gulp-cond';
var prod = gulp.env.prod;
// Images
gulp.task('build_images', function() {
gulp.src('assets/images/**/*.svg')
.pipe(cond(prod,
gSvgmin.bind(null, options), // minify SVG images under production
function () { // use live reload in dev mode
return gWatch().pipe(gLivereload(server));
})
)
.pipe(gulp.dest('www/images'))
});
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.
Type: Stream
or Function
Required. A stream or a function providing a stream.
Type: Stream
or Function
Default value: Stream.PassThrough
A stream or a function providing a stream.
You may want to contribute to this project, pull requests are welcome if you accept to publish under the MIT license.
FAQs
Ternary operator for Gulp.
The npm package gulp-cond receives a total of 0 weekly downloads. As such, gulp-cond popularity was classified as not popular.
We found that gulp-cond demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.