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
govuk_publishing_components-16.28.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.27.1 node_modules/loose-envify/README.md
govuk_publishing_components-16.27.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.26.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.25.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.24.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.23.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.22.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.21.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.20.1 node_modules/loose-envify/README.md
govuk_publishing_components-16.20.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.19.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.18.0 node_modules/loose-envify/README.md
govuk_publishing_components-16.17.0 node_modules/loose-envify/README.md
optimacms-0.4.3 spec/dummy/node_modules/loose-envify/README.md
optimacms-0.4.2 spec/dummy/node_modules/loose-envify/README.md
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/loose-envify/README.md
lux_assets-0.2.11 ./node_modules/loose-envify/README.md
lux_assets-0.2.9 ./node_modules/loose-envify/README.md
lux_assets-0.2.4 ./node_modules/loose-envify/README.md