# env-man

> A simple plugin for managing environment variables in nodejs

Latest version **0.0.2** (published 2021-07-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install env-man
pnpm add env-man
yarn add env-man
bun add env-man
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-07-29 |
| First published | 2021-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Spiff Jekey-Green |
| Maintainers | spiffgreen |
| Keywords | env, manager, nodejs, node, variables, environment |

## Links

- npm: https://www.npmjs.com/package/env-man
- Repository: https://github.com/SpiffGreen/env-manager
- Homepage: https://github.com/SpiffGreen/env-man#readme
- Issues: https://github.com/SpiffGreen/env-man/issues
- npm.io page: https://npm.io/package/env-man

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2021-07-29
- 0.0.0 — 2021-07-20

## README

## Env-Manager

### Methods
* `config` - This method will load environment variables into process.env object from the `/folder/.env` where folder is a parameter passed to the config method.
* `set` - This method accepts two parameters:
    
    * `parameter 1` key - set on process.env object
    * `parameter 2` the value to be stored on process.env[key]
* `get` - This method accepts one parameter: `key` and returns the value of `process.env[key]`;
* `loadFromFile` - Accepts one parameter: `filePath`, this method loads environment variables from specified filePath into the process.env object for use in the current executing program.

### Installation
```sh
npm install env-manager
```

### Examples
#### Basic Usage
The example below will load environment variables from a `.env` file in the current folder.
```js
require("env-manager").config(__dirname);
```

#### Set values
```js
const envManager = require("env-manager");
envManager.set("DB_HOST", "...."); // process.env.DB_HOST = "...."
```

#### Get values
```js
const envManager = require("env-manager");
console.log(envManager.get("DB_HOST"));
// outputs value of process.env.DB_HOST
```

### Contributions
Your contributions are welcome no matter how small.

### License
[MIT](./LICENSE) Licensed.

---
_Source: https://npm.io/package/env-man · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
