# envarify

> A convenience utility to verify all required node environment variables are set.

Latest version **0.9.1** (published 2017-12-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install envarify
pnpm add envarify
yarn add envarify
bun add envarify
```

## 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.9.1 |
| Published | 2017-12-05 |
| First published | 2017-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | alchemi |
| Keywords | environmental, variables, verify, validate |

## Links

- npm: https://www.npmjs.com/package/envarify
- Repository: https://github.com/alchemiio/envarify
- Homepage: https://github.com/alchemiio/envarify#readme
- Issues: https://github.com/alchemiio/envarify/issues
- npm.io page: https://npm.io/package/envarify

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) 2.3.0
- [lodash.findindex](https://npm.io/package/lodash.findindex.md) 4.6.0

## 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.9.1 (latest) — 2017-12-05

## README

# Envarify

### Description

Envarify is a simple utility to verify that all required node environmental variables required for an application to run are defined in the application's current environment.

This utility will compare variable keys passed into it, with the variables defined in the application's node environment, logging out the status of each variable. If any of the required environmental variables are not defined the application will be terminated early.

This tool was created to assist mitigate runtime errors in larger node projects that may rely on many environmental variables. Undefined environmental variables may not be verified until they are invoked at runtime and so they may not be immediately apparent to the developer. This tool is especially suitable for applications that may be deployed in many different environments during its development cycle.



## Install
```
$ npm install envarify --save

```

## Quick Start

Import:
```javascript
const {envarify} = require('envarify');

//ES2015
import envarify from 'envarify';

```

Invoke:
```javascript
//Define your required environmental variable keys, may be imported from remote source or json.
const variables = [
    {key:"EXAMPLE_REQUIRED_ENVIRONMENTAL_VARIABLE", isRequired:true},
    {key:"EXAMPLE_OPTIONAL_ENVIRONMENTAL_VARIABLE", isRequired:false}
    ];

//expects [{key:"string", isRequired:boolean}]
envarify(variables);

//envarify will output results to console.

```

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