A dead simple package for getting environment variables.
npm i get-env-variable
Both export and default export are available
import { getEnvironmentVariable } from 'get-env-variable'
// With default value
// This will return 3000 if PORT environment variable does not exists
const PORT = Number(getEnvironmentVariable('PORT', '3000'))
// Without default value
// This will throw error if PORT environment variable does not exists
const PORT = Number(getEnvironmentVariable('PORT'))