Skip to content

kinland/gulp-inject-envs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-inject-envs

package version package downloads standard-readme compliant package license make a pull request

Gulp plugin to inject environment variables

Table of Contents

About

Inject variables with configurable prefix. Based on gulp-inject-env-variables.

Install

This project uses node and npm.

$ npm install gulp-inject-envs
$ # OR
$ yarn add gulp-inject-envs

Usage

const injectEnvs = require('gulp-inject-envs')
const env = { foo: 'bar', ping: 'pong' }

gulp.src('**/*.js')
  .pipe(injectEnvs(env)) // set custom prefix with second argument e.g. {prefix: 'CUSTOM___' }
  .pipe(gulp.dest('/'))

And in code:

const foo = '<ENV::foo>'
console.log(foo) // bar

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature'
  3. Push to the branch: git push origin my-new-feature
  4. Submit a pull request

License

MIT

About

Gulp plugin to inject environment variables

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%