Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/poorlydefinedbehaviour/process-env-loader

load environment variables into node's process.env
https://github.com/poorlydefinedbehaviour/process-env-loader

Last synced: 14 days ago
JSON representation

load environment variables into node's process.env

Awesome Lists containing this project

README

        

# About

Yet another env loader.

## Installation

\$ [npm](https://www.npmjs.com) i process-env-loader

## Usage

```js
import load from "process-env-loader";
load(); // Loads .env from the root of the directory
```

```js
import load from "process-env-loader";
load("mypath/subfolder/"); // Loads .env from the specified folder
```

```js
import load from "process-env-loader";
/**
* The key value pairs can be separated by anything,
* as long as you specify the separator when loading the file.
* */
load("mypath/subfolder/", "->"); // Loads .env from the specified folder, using the specified seperator
```

.env could look like one of these

```js
FOO=BAR
```

```js
FOO->BAR
```

```js
FOO,BAR
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)