# envbyjson

> the js project of envjson which loads env vars from json files.

Latest version **1.0.1** (published 2023-04-28) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-04-28 |
| First published | 2023-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | lifthus |
| Maintainers | lifthus |
| Keywords | env, json, dotenv, envbyjson |

## Links

- npm: https://www.npmjs.com/package/envbyjson
- Repository: https://github.com/lifthus/envbyjson.git#main
- Homepage: https://github.com/lifthus/envbyjson
- Issues: https://github.com/lifthus/envbyjson/issues
- npm.io page: https://npm.io/package/envbyjson

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-04-28
- 1.0.0 — 2023-04-28
- 0.2.0 — 2023-04-27
- 0.1.0 — 2023-04-27

## README

# envbyjson

the JavaScript project of [envbyjson](https://github.com/lifthus/envbyjson) which loads env vars from json files.

## Installation

As a library

```shell
npm install envbyjson

yarn add envbyjson
```

## Usage

Add your application configuration to json files like

```shell
{
  "A": "got A",
  "B": "got B"
}

or like

{ 
  "Parameters" : {
    "A": "got A",
    "B": "got B"
    }
}
```

if you don't specify the file paths, envbyjson loads "env.json" in your project root directory.

in your JS app you can do something like

```javascript
import envbyjson from "envbyjson";

  // it loads env.json file in the root directory
  envbyjson.load()
  console.log(process.env.A)

  // it loads env2.json file in the testdata directory
  envbyjson.load("testdata/env2.json")
  console.log(process.env.B)

  // now do whatever with the configuration values.
}

```

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