# loose-envify

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

Latest version **1.4.0** (published 2018-07-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install loose-envify
pnpm add loose-envify
yarn add loose-envify
bun add loose-envify
```

Provides the command `loose-envify`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2018-07-10 |
| First published | 2015-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 283 |
| Author | Andres Suarez |
| Maintainers | zertosh |
| Keywords | environment, variables, browserify, browserify-transform, transform, source, configuration |

## Links

- npm: https://www.npmjs.com/package/loose-envify
- Repository: https://github.com/zertosh/loose-envify
- Issues: https://github.com/zertosh/loose-envify/issues
- npm.io page: https://npm.io/package/loose-envify

## Dependencies (1)

- [js-tokens](https://npm.io/package/js-tokens.md) ^3.0.0 || ^4.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2018-07-10
- 1.3.1 — 2017-01-15
- 1.3.0 — 2016-10-28
- 1.2.0 — 2016-05-15
- 1.1.0 — 2015-10-18
- 1.0.0 — 2015-09-21

## README

# 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
```

---
_Source: https://npm.io/package/loose-envify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
