env-utils

2.2.1 • Public • Published

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'})

Readme

Keywords

Package Sidebar

Install

npm i env-utils

Weekly Downloads

48

Version

2.2.1

License

MIT

Last publish

Collaborators

  • danethurber
  • leoduran