typed-env
v1.0.1
Published
Typed environment variable parser
Downloads
43
Maintainers
Readme
typed-env
A typed environment variable parser.
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)