@01/env
v2.2.2
Published
A tiny env parser for nodejs and browser
Downloads
2,132
Readme
env
Nodejs env utils
env
const nodeEnv:string = env("NODE_ENV", "development")
// process.env.NODE_ENV or "development"
envInt
const timeout:number = envInt("TIMEOUT", 5000)
// process.env.TIMEOUT as int or 5000
envFloat
const scaleFactor:number = envFloat("SCALE_FACTOR", 2.56)
// process.env.SCALE_FACTOR as float or 2.56
envBoolean
const isEnabled:boolean = envBoolean("IS_ENABLED", false)
// process.env.IS_ENABLED as boolean or false