Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 418 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 418 Bytes

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)