loose-envify
Fast (and loose) selective `process.env` replacer using js-tokens instead of an AST
Last updated 2 years ago by zertosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install loose-envify 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.4.0                                ...           latest (2 years ago)

6 Versions

  • 1.4.0                                ...           2 years ago
  • 1.3.1                                ...           3 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 9,962
This Week 178,660
This Month 110,095
Last Day 31,815
Last Week 156,389
Last Month 774,332
Dependencies (1)
Dev Dependencies (3)
Dependents (483)

Copyright 2014 - 2016 © taobao.org |