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
- Host: GitHub
- URL: https://github.com/pr4j3sh/env-parser
- Owner: pr4j3sh
- License: mit
- Created: 2025-04-13T15:32:15.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-18T04:31:27.000Z (about 1 year ago)
- Last Synced: 2025-09-03T07:01:55.443Z (9 months ago)
- Topics: env, env-parser, environment-variables, json
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@pr4j3sh/env-parser
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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/)