https://github.com/rguj/node-env-parser
No more headaches! Your best utility for parsing .env variables in Node JS. Code was built based from Laravel's ENV parsing principle.
https://github.com/rguj/node-env-parser
config dotenv dotenv-parser env environment-variables javascript js key-value nodejs npm parser server-side
Last synced: 4 months ago
JSON representation
No more headaches! Your best utility for parsing .env variables in Node JS. Code was built based from Laravel's ENV parsing principle.
- Host: GitHub
- URL: https://github.com/rguj/node-env-parser
- Owner: rguj
- License: gpl-3.0
- Created: 2021-09-28T01:19:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-29T00:31:50.000Z (over 4 years ago)
- Last Synced: 2025-10-27T15:49:09.029Z (4 months ago)
- Topics: config, dotenv, dotenv-parser, env, environment-variables, javascript, js, key-value, nodejs, npm, parser, server-side
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# node-env-parser
No more headaches! Your best utility for parsing .env variables in Node JS. Code was built based from Laravel's ENV parsing principle.
## Instruction
1) Put this file at the root of the project folder the same level as `main.js` and `.env` file
2) Prepend this code at the most top of your `main.js` file:
```js
global.env = require('./node-env-parser').parse();
```
3) You can access your .env variables anywhere in your project (server-side)
```js
console.log(global.env.SAMPLE_KEY);
```
4) Please suggest revisions of this code to enhance it
## License
[GNU GPLv3](https://choosealicense.com/licenses/gpl-3.0/)