# dotenv-json

> Load environment variables via a JSON file

Latest version **1.0.0** (published 2017-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install dotenv-json
pnpm add dotenv-json
yarn add dotenv-json
bun add dotenv-json
```

## 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.0.0 |
| Published | 2017-09-27 |
| First published | 2017-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Max Beatty |
| Maintainers | maxbeatty |
| Keywords | dotenv |

## Links

- npm: https://www.npmjs.com/package/dotenv-json
- Repository: https://github.com/maxbeatty/dotenv-json
- Homepage: https://github.com/maxbeatty/dotenv-json#readme
- Issues: https://github.com/maxbeatty/dotenv-json/issues
- npm.io page: https://npm.io/package/dotenv-json

## 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.0.0 (latest) — 2017-09-27

## README

# dotenv-json

> Load environment variables via a JSON file

```bash
npm install dotenv-json
```

Define your environment variables in `.env.json` in the root of your project (or wherever you start your node process):

```json
{
  "public_api_key": "s@Mpl3_d@Ta"
}
```

Load your environment variables at the beginning of your program:

```js
require("dotenv-json")();

console.log(process.env.public_api_key) // => s@Mpl3_d@Ta
```

_N.B. Existing keys in `process.env` will **not** be overwritten._

You can customize the location of your `.env.json` file by passing a `path` option:

```js
const dotenvJSON = require("dotenv-json");
dotenvJSON({ path: "./config/example.json"});
```

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