Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-options

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-options

Allow to pass gulp options and retreive them

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-15.88%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-options

Add options parameters in Gulp to be used like:

gulp build --myopt1 --myopt2 --myopt3=val

Install

npm install gulp-options

Example

gulpfile.js

var gulp = require('gulp');
var options = require('gulp-options');

gulp.task('mytask', function() {

    if (options.has('prod')) {

        // Do prod stuff...
        return gulp.src('src/**/*.*').pipe(gulp.dest('release/'));

    } else if (options.has('debug')) {

        // Do debug stuff..
        return gulp.src('src/**/*.*').pipe(gulp.dest('debug/'));

    } else {

        // Do default stuff..
        return gulp.src('src/**/*.*').pipe(gulp.dest('dev/'));
    }

    // Get option value
    if (options.has('env')) {
        const env = options.get('env');
        return gulp.src('src/**/*.*').pipe(gulp.dest(`${env}/`));
    }
});

gulp commands with example gulpfile.js

gulp mytask --prod          # source files moved to  release/ folder
gulp mytask --debug         # source files moved to  debug/ folder
gulp mytask --env=customenv # source files moved to  customenv/ folder
gulp mytask                 # source files moved to  dev/ folder

Keywords

FAQs

Package last updated on 03 Nov 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc