# @collection-nest/environment

> Wrapper around `@nestjs/config` so that we can have more control over environment variables and project configuration in general.

Latest version **0.7.3** (published 2022-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @collection-nest/environment
pnpm add @collection-nest/environment
yarn add @collection-nest/environment
bun add @collection-nest/environment
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.3 |
| Published | 2022-01-19 |
| First published | 2021-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 1 |
| Unpacked size | 583 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | michal.jarnot |

## Links

- npm: https://www.npmjs.com/package/@collection-nest/environment
- npm.io page: https://npm.io/package/@collection-nest/environment

## Dependencies (1)

- [@nestjs/config](https://npm.io/package/@nestjs/config.md) 1.1.6

## Recent versions

- 0.7.3 (latest) — 2022-01-19
- 0.7.2 — 2022-01-19
- 0.7.1 — 2022-01-19
- 0.7.0 — 2022-01-19
- 0.6.0 — 2022-01-19
- 0.5.3 — 2022-01-17
- 0.5.2 — 2022-01-17
- 0.5.1 — 2022-01-17
- 0.5.0 — 2022-01-17
- 0.4.1 — 2022-01-17
- 0.4.0 — 2022-01-17
- 0.3.0 — 2022-01-17
- 0.2.1 — 2022-01-17
- 0.2.0 — 2022-01-17
- 0.1.1 — 2021-02-26
- … 1 more at https://npm.io/package/@collection-nest/environment/versions

## README

# @nest-collection/environment

Wrapper around `@nestjs/config` so that we can have more control over environment variables and project configuration in
general.

## Install

```
yarn add @collection-nest/environment
```

## Example

```typescript
const nodeEnvToPath = {
  production: '.env.production',
  development: '.env.development',
}

const NODE_ENV = process.env.NODE_ENV as keyof typeof nodeEnvToPath

// Optional
const validationSchema = Joi.object({
  NODE_ENV: Joi.string().valid('development', 'production').required(),
  PORT: Joi.number().default(3000),
})

const envFilePath = nodeEnvToPath[NODE_ENV]

EnvironmentModule.register({
  envFilePath,
  validationSchema,
})
```

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