gulp-inject-envs

1.2.0 • Public • Published

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

Install

Install the package locally within you project folder with your package manager:

With npm:

npm install gulp-inject-envs

With yarn:

yarn add gulp-inject-envs

With pnpm:

pnpm 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

Contributing

Got an idea for a new feature? Found a bug? Contributions are welcome! Please open up an issue or make a pull request.

License

MIT © Tiaan du Plessis

Dependents (1)

Package Sidebar

Install

npm i gulp-inject-envs

Weekly Downloads

38

Version

1.2.0

License

MIT

Unpacked Size

4.08 kB

Total Files

4

Last publish

Collaborators

  • tiaanduplessis