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

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

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.