https://github.com/dinoscapeprogramming/environment-reader
A simple environment reader using fs
https://github.com/dinoscapeprogramming/environment-reader
Last synced: 8 months ago
JSON representation
A simple environment reader using fs
- Host: GitHub
- URL: https://github.com/dinoscapeprogramming/environment-reader
- Owner: DinoscapeProgramming
- License: apache-2.0
- Created: 2022-02-14T18:08:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-25T08:40:23.000Z (over 4 years ago)
- Last Synced: 2025-02-12T17:28:37.776Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Environment Reader
A simple environment reader using fs
## Get started
First copy the file __environment-reader.js__ to your code. Now you're ready to use this package.
## Introduction
### Require the package
```js
const env = require('./environment-reader.js');
```
### Get the whole content from a file
```js
env('./text.txt')
```
### Get a specific line from a file
```js
env('./text.txt', 0)
```
## Replit
Yes, you can add environment variables to your file. Only add this to your file:
```
process.env.test
```
## Note
You also can use this with any other file beside text files, but I think text files are the best solution for environment variables.