# env

> Environment variable manager

Latest version **0.0.2** (published 2011-11-28) · 0 weekly downloads

## Install

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

## 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 | 2011-11-28 |
| First published | 2011-11-28 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.5.9 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Daniel D. Shaw |
| Maintainers | dshaw |
| Keywords | process, environment, env |

## Links

- npm: https://www.npmjs.com/package/env
- Repository: https://github.com/dshaw/env
- npm.io page: https://npm.io/package/env

## 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) — 2011-11-28
- 0.0.1 — 2011-11-28

## README

Env - In your environment managing your variables.
===

[![Build Status](https://secure.travis-ci.org/dshaw/env.png)](http://travis-ci.org/dshaw/env)

Managing environment variables can be a pain. Env helps make that better.

### Module status

Env is an evolving project based which came out of discussions with [@joemccann](http://twitter.com/joemccann) and [@clintandrewhall](http://twitter.com/clintandrewhall). I don't consider this package fully baked yet.

### Get Env.

```bash
npm install env
```

### Usage

Add an env.json file to your repo.

```json
{
  "DB_HOST": 1,
  "DB_PORT": 1,
  "DB_USER": 1,
  "DB_PASS": 1
}
```

```javascript
var env = require('env')()

env.ok(function(err) {
  if (!err) return
  console.error(err)
  process.exit(1)
})

// Yes, it's SYNC, so you can do this too!

function handleEnv (err) {
  if (!err) return
  process.exit(1)
}

if (env.ok(handleEnv)) {
  var port = env.get('SETUP_PORT')
  server.listen(port)
}
```

Env is sync like require, so it's tasks can be accomplished before app execution.

### Follow dshaw
- [twitter.com/dshaw](http://twitter.com/dshaw)
- [github.com/dshaw](http://github.com/dshaw)

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