Sha256: aa0fd3195adec32cb17d9b65498bc921eb38398cac07e091a2df097028eacdc9

Contents?: true

Size: 1.05 KB

Versions: 148

Compression:

Stored size: 1.05 KB

Contents

# loose-envify

[![Build Status](https://travis-ci.org/zertosh/loose-envify.svg?branch=master)](https://travis-ci.org/zertosh/loose-envify)

Fast (and loose) selective `process.env` replacer using [js-tokens](https://github.com/lydell/js-tokens) instead of an AST. Works just like [envify](https://github.com/hughsk/envify) but much faster.

## Gotchas

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

## Usage/Options

loose-envify has the exact same interface as [envify](https://github.com/hughsk/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
```

Version data entries

148 entries across 148 versions & 21 rubygems

Version Path
condenser-0.0.8 lib/condenser/processors/node_modules/loose-envify/README.md
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/loose-envify/README.md
jester-data-8.0.0 node_modules/loose-envify/README.md
ezii-os-5.2.1 node_modules/loose-envify/README.md
ezii-os-2.0.1 node_modules/loose-envify/README.md
ezii-os-1.1.0 node_modules/loose-envify/README.md
ezii-os-1.0.0 node_modules/loose-envify/README.md
condenser-0.0.7 lib/condenser/processors/node_modules/loose-envify/README.md
ezii-os-0.0.0.1.0 node_modules/loose-envify/README.md
ezii-os-0.0.0.0.1 node_modules/loose-envify/README.md
govuk_publishing_components-18.0.0 node_modules/loose-envify/README.md
govuk_publishing_components-17.21.0 node_modules/loose-envify/README.md
govuk_publishing_components-17.20.0 node_modules/loose-envify/README.md
govuk_publishing_components-17.19.1 node_modules/loose-envify/README.md
govuk_publishing_components-17.19.0 node_modules/loose-envify/README.md
condenser-0.0.5 lib/condenser/processors/node_modules/loose-envify/README.md
govuk_publishing_components-17.18.0 node_modules/loose-envify/README.md
govuk_publishing_components-17.17.0 node_modules/loose-envify/README.md
govuk_publishing_components-17.16.0 node_modules/loose-envify/README.md
govuk_publishing_components-17.15.0 node_modules/loose-envify/README.md