🌜
🌞
loose-envify

loose-envify

v1.4.0

Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST

npm install loose-envify

README

loose-envify

Build Status

Fast (and loose) selective process.env replacer using js-tokens instead of an AST. Works just like envify but much faster.

Gotchas

  • Doesn't handle broken syntax.
  • Doesn't look inside embedded expressions in template strings.
    • this won't work:
      console.log(`the current env is ${process.env.NODE_ENV}`);
      
  • Doesn't replace oddly-spaced or oddly-commented expressions.
    • this won't work:
      console.log(process./*won't*/env./*work*/NODE_ENV);
      

Usage/Options

loose-envify has the exact same interface as envify, including the CLI.

Benchmark

envify:

  $ for i in {1..5}; do node bench/bench.js 'envify'; done
  708ms
  727ms
  791ms
  719ms
  720ms

loose-envify:

  $ for i in {1..5}; do node bench/bench.js '../'; done
  51ms
  52ms
  52ms
  52ms
  52ms

General

License
MIT
Typescript Types
None found
Tree-shakeable
No

Popularity

GitHub Stargazers
263
Community Interest
289
Number of Forks
26

Maintenance

Commits
10/219/2201
Last Commit
Jul 10, 2018
Open Issues
2
Closed Issues
4
Open Pull Requests
2
Closed Pull Requests
2

Versions

Versions Released
10/219/2201
Latest Version Released
Jul 10, 2018
Current Tags
latest1.4.0

Dependencies

Dependencies (1)
Dev Dependencies (3)

Contributors

zertosh
zertosh
Commits: 26
realityking
realityking
Commits: 1
lydell
lydell
Commits: 1
mattiasa
mattiasa
Commits: 1
tomashanacek
tomashanacek
Commits: 1