An open API service indexing awesome lists of open source software.

https://github.com/pr4j3sh/env-parser

parses env variables to json
https://github.com/pr4j3sh/env-parser

env env-parser environment-variables json

Last synced: 3 months ago
JSON representation

parses env variables to json

Awesome Lists containing this project

README

          

# env parser

This is a javascript npm package that parses `ENV` variables to `JSON`.

## Installation

- Install using npm

```bash
npm i @pr4j3sh/env-parser
```

## Usage

- Require `@pr4j3sh/env-parser` in your file.

```js
const Parser = require("@pr4j3sh/env-parser");

const p = new Parser();

let json = p
.input(
"APP_NAME=MyApp\nAPP_ENV=production\nAPP_PORT=4892\nAPP_SECRET=sdj32j42hfs73ksdlfh29dsfsd\n",
)
.parse()
.toJson();

// provide file path
json = p.fileInput(".env").parse().toJson();
```

## Reference

- [NodeJS Documentation](https://nodejs.org/en/learn/getting-started/introduction-to-nodejs)
- [NPM Documentation](https://docs.npmjs.com/)
- [@pr4j3sh/frames](https://pr4j3sh.github.io/frames/)