Files
setup-php/node_modules/loose-envify
Shivam Mathur 43178a7254
Main workflow / Run (ubuntu-latest, 5.6) (push) Failing after 0s
Main workflow / Run (ubuntu-latest, 7.0) (push) Failing after 0s
Main workflow / Run (ubuntu-latest, 7.1) (push) Failing after 0s
Main workflow / Run (ubuntu-latest, 7.2) (push) Failing after 0s
Main workflow / Run (ubuntu-latest, 7.3) (push) Failing after 0s
Main workflow / Run (macOS-latest, 5.6) (push) Canceled after 0s
Main workflow / Run (macOS-latest, 7.0) (push) Canceled after 0s
Main workflow / Run (macOS-latest, 7.1) (push) Canceled after 0s
Main workflow / Run (macOS-latest, 7.2) (push) Canceled after 0s
Main workflow / Run (macOS-latest, 7.3) (push) Canceled after 0s
Main workflow / Run (windows-latest, 5.6) (push) Canceled after 0s
Main workflow / Run (windows-latest, 7.0) (push) Canceled after 0s
Main workflow / Run (windows-latest, 7.1) (push) Canceled after 0s
Main workflow / Run (windows-latest, 7.2) (push) Canceled after 0s
Main workflow / Run (windows-latest, 7.3) (push) Canceled after 0s
Improve code quality and write tests
2019-09-20 21:54:46 +05:30
..
2019-09-20 21:54:46 +05:30
2019-09-20 21:54:46 +05:30
2019-09-20 21:54:46 +05:30
2019-09-20 21:54:46 +05:30
2019-09-20 21:54:46 +05:30

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