Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.75 KB

README.md

File metadata and controls

62 lines (42 loc) · 1.75 KB

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