Socket
Book a DemoInstallSign in
Socket

@zebrajaeger/gulp-simple-env

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zebrajaeger/gulp-simple-env

Simple Environment Plugin for Gulp

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-simple-env

NPM version License Size

Define your environments

I.E. we define two environments: 'foo' and 'bar'.

const e = require('@zebrajaeger/gulp-simple-env')({
    env: ['foo', 'bar']
});

You can define as much environments as you want.

Hint:

For js-conform naming, the env-names are camel-cased. 'my-great-env' becomes to isMyGreatEnv(...). The command line name is unchanged: gulp --my-great-env For the replacement strategy, take a look at https://www.npmjs.com/package/camelcase

Activate environment through command line argument(s)

gulp --foo
gulp --bar
gulp --foo --bar

Generic: Check if a specific environment is (not) set

e.isFoo(): true or false 
e.isNotFoo(): true or false
e.isBar(): true or false 
e.isNotBar(): true or false

Gulp: Execute tasks dependent from environment

gulp.src(...).pipe( e.isFoo(...) ).dest(...);
gulp.src(...).pipe( e.isNotFoo(...) ).dest(...);
gulp.src(...).pipe( e.isBar(...) ).dest(...);
gulp.src(...).pipe( e.isNotBar(...) ).dest(...);

As an alternative you can provide a trueStream and a falseStream

.pipe( e.isFoo(uglify(), prettify()) )

Your example gulpfile.js

const g = require('gulp');
const e = require('@zebrajaeger/gulp-simple-env')({env: ['foo', 'bar']});

const print = require('gulp-print').default;

g.task('default', cb => {
    return g
        .src('*.js')
        .pipe(e.isFoo(print()))
});

FAQs

Package last updated on 02 Feb 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.