1.0.1 • Published 4 years ago

typed-env v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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)