# envisage

> Assign Environmental Variables to a JavaScript Object.

Latest version **0.2.0** (published 2025-01-21) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install envisage
pnpm add envisage
yarn add envisage
bun add envisage
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2025-01-21 |
| First published | 2022-04-18 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | config, env |

## Links

- npm: https://www.npmjs.com/package/envisage
- Repository: https://github.com/DanielJDufour/envisage
- Homepage: https://github.com/DanielJDufour/envisage#readme
- Issues: https://github.com/DanielJDufour/envisage/issues
- npm.io page: https://npm.io/package/envisage

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2025-01-21
- 0.1.0 — 2022-08-06
- 0.0.1 — 2022-04-18

## README

# envisage
> Assign Environmental Variables to a JavaScript Object.

# basic usage

```js
// in webpack.config.js
const evisage = require("envisage");

const config = {
  mode: "production",
  // ...
};

envisage.assign({ target: config, prefix: "WEBPACK" });

module.exports = config;
```

```bash
WEBPACK_OUTPUT_FILENAME="library.min.js" WEBPACK_WATCH="true" webpack --config webpack.config.js
```

### advanced usage
```js
// modifies target config in place
envisage.assign({
  target: config,

  // only look for environmental variables
  // that start with "WEBPACK..."
  // like WEBPACK_OUTPUT_FILENAME  
  prefix: "WEBPACK",

  // default true
  // convert environmental variable name
  // to lowercase for target object key
  lowercase: true,

  // default true
  // convert boolean string values "true" and "false"
  // to Boolean types for target object value
  convert_boolean: true,

  // default true
  // convert integer string values
  // to Number types for target object value
  convert_integer: true
});
```

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