force-num
v1.0.0
Published
Ensure environment variable exists and convert to a number. If not, throw to fail early.
Downloads
7
Readme
Ensure environment variable exists and convert to a number. If not, throw to fail early.
import forceNum from 'force-num'
const nodeEnv = forceNum('PORT')
// => 3000, or throw if not set or not a number