Skip to content

danethurber/env-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ENV Utils

Circle CI

Easily Get Environment Variables

Install

$ npm install env-utils

Methods

getEnvVar

gets an environment variable

import {getEnvVar} from 'env-utils'
const PORT = getEnvVar('PORT')

You can force the value to be a boolean

const PORT = getEnvVar('PORT', { boolean: true })

And if your env variable is a comma separated string you can get back an array instead

const PORT = getEnvVar('PORT', { commaSeparated: true })

You can also set a fallback value for development mode

const PORT = getEnvVar('PORT', { devDefault: '1234'})

About

Environment Utilities

Resources

Stars

Watchers

Forks

Packages

No packages published