# @nod/environment

> Creates merged config object after parsing dotenv and current env variables

Latest version **4.6.1** (published 2016-01-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @nod/environment
pnpm add @nod/environment
yarn add @nod/environment
bun add @nod/environment
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.6.1 |
| Published | 2016-01-26 |
| First published | 2015-09-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | NOD studios |
| Maintainers | jacopkane, nod |
| Keywords | config, configuration, dotenv, env, environment, js, nod, node, es6, es7 |

## Links

- npm: https://www.npmjs.com/package/@nod/environment
- Repository: https://github.com/nod-studios/environment
- Homepage: https://github.com/nod-studios/environment#readme
- Issues: https://github.com/nod-studios/environment/issues
- npm.io page: https://npm.io/package/@nod/environment

## Dependencies (7)

- [dotenv](https://npm.io/package/dotenv.md) ^2.0.0
- [app-root-path](https://npm.io/package/app-root-path.md) ^1.0.0
- [decorate-this](https://npm.io/package/decorate-this.md) ^0.5.0
- [filter-object](https://npm.io/package/filter-object.md) ^2.1.0
- [autobind-decorator](https://npm.io/package/autobind-decorator.md) ^1.3.3
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.4.0
- [node-env-configuration](https://npm.io/package/node-env-configuration.md) 0.0.6

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 4.6.1 (latest) — 2016-01-26
- 4.6.2 — 2016-01-26
- 4.5.1 — 2016-01-26
- 4.5.0 — 2016-01-26
- 4.4.3 — 2016-01-26
- 4.4.2 — 2016-01-26
- 4.4.1 — 2016-01-26
- 4.4.0 — 2016-01-26
- 4.3.0 — 2016-01-26
- 4.2.0 — 2016-01-26
- 4.1.1 — 2016-01-20
- 3.2.4 — 2016-01-10
- 3.2.3 — 2016-01-10
- 3.2.2 — 2015-09-26
- 3.2.1 — 2015-09-26
- … 6 more at https://npm.io/package/@nod/environment/versions

## README

# @nod/environment

Creates merged config object after parsing dotenv and current env variables through javascript.

Supports ES5, ES7, AMD, CommonJS, System and ES6 modules.

### Platform
Works in node.js also should(?) work in browser.

[![GitHub tag][tag-image]][tag-url]
[![Build status][build-image]][build-url]
[![Dependency Status][david-image]][david-url]
[![Join the chat][gitter-image]][gitter-url]


# Usage:

## Installation:
```
npm install --save @nod/environment
```

## Examples:

```javascript
import { Environment } from '@nod/environment';

let environment = new Environment();

let { ENV, config, json } = environment;

//config is also environment variables but converted into object notation
console.log({ config, ENV, json });
```

## Configuring
```javascript
import { Environment, Configuration as EnvConfig } from '@nod/environment';
import path from 'path';
let environment = new Environment(new EnvConfig {
  silent : true, //should this.console.log issues like missing files or not
  files : [ // files to look in the path    
    '.env.local',
    '.env.production',
    '.env.test',
    '.env.development',
    '.env',
    '.env.nod'
  ],
  root : path.resolve('.'), // root path for .env files
  exclude : false //exclude with filter-object for json output
}, console //console and other deps can replaced);
```

## Build and develop:
```bash
gulp
```
or
```bash
npm run build
npm run watch
```
Please check available gulp tasks with:
```bash
gulp -T
```

## API
All methods have strict type checking please check source code.

# ToDo:
- Gulp tasks as another dependency
- More detailed docs

# Contact:
[![Send e-mail][mail-image]][mail-url]
[![Join the chat][gitter-image]][gitter-url]

[![forthebadge](http://forthebadge.com/images/badges/built-with-love.svg)](http://nod.st)
by [NOD studios](http://nod.st)


[logo-image]: ./image/logo.strap.png?raw=true
[repo-url]: https://github.com/NOD-studios/environment
[david-url]: https://david-dm.org/NOD-studios/environment
[david-image]: https://david-dm.org/NOD-studios/environment.svg
[gitter-image]: https://img.shields.io/badge/GITTER-join%20chat-green.svg
[gitter-url]: http://bit.ly/NOD-chat
[mail-image]: https://img.shields.io/badge/send-email-green.svg
[mail-url]: mailto:hey@nod.st
[tag-image]: https://img.shields.io/github/tag/NOD-studios/environment.svg
[tag-url]: https://github.com/NOD-studios/environment/tags
[build-image]: https://travis-ci.org/NOD-studios/environment.svg
[build-url]: https://travis-ci.org/NOD-studios/environment

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