Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/itslukej/typed-env

💾 Typed environment variable parser.
https://github.com/itslukej/typed-env

config configuration environment-variables typescript

Last synced: 3 months ago
JSON representation

💾 Typed environment variable parser.

Awesome Lists containing this project

README

        

# typed-env

A typed environment variable parser.

```ts
import config from 'typed-env';

const cfg = config({
PORT: { type: 'number', optional: true, default: 80 },
HOMEPAGE: { parser: url.parse }
})

cfg.PORT // number
cfg.HOMEPAGE // URL object
```

## Features
- Strongly typed
- Support for custom parsers
- Support for optional environment variables
- Support for passing in custom environments (see Options)