typed-env

v1.0.1
Typed environment variable parser
environment variables env parser env parser typescript typed config

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)
npm i typed-env

Metadata

  • MIT
  • Whatever
  • Luke James
  • released 2/19/2020

Downloads

Maintainers