@wavesenterprise/env-extractor
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Extract envs from process.env

import { Env } from '@wavesenterprise/env-extractor'

// num resolves as number
const num = Env.number('PORT').default(3030).get()
// str resolves as string
const str = Env.string('API_KEY').required().get()
// bool resolves as boolean | undefined 
// because nor default nor required were set
const bool = Env.boolean('IS_DEV').get()
// json resolves as { isNice: boolean } | undefined
const json = Env.json<{ isNice: boolean }>('NICE_ENV').get()

This package does not set envs to process.env use dotenv package with it

Package Sidebar

Install

npm i @wavesenterprise/env-extractor

Weekly Downloads

3

Version

1.0.3

License

ISC

Unpacked Size

6.49 kB

Total Files

5

Last publish

Collaborators

  • stfy
  • sergeymart
  • nbugaev
  • wavesadmin
  • aklyavlin
  • dimalitvinov
  • mikhail.milekhin