Type declarations included
$ npm install --save @naxmefy/env
import env from '@naxmefy/env'
const NodeEnv: string = env('NODE_ENV', 'development')
const aNumber: number = env('A_NUMBER', '10', Number)
const hello: string = env('USERNAME', 'John', v => `Hello ${v}!`)
import {glob} from '@naxmefy/env'
// e.g.:
interface IDBVars {
DB_URL?: string
DB_USER?: string
}
// load vars
const dbVars = glob('DB_*') as IDBVars
// e.g.:
console.log(dbVars.DB_URL)
console.log(dbVars.DB_USER)
Use Versions 1.x.x
Use Versions 2.x.x