@naxmefy/env

env vars util


Keywords
environment-variables, nodejs, typescript
License
MIT
Install
npm install @naxmefy/env@2.2.0

Documentation

@naxmefy/env

npm version required node version

Build Status Coverage Status

Type declarations included

Installation

$ npm install --save @naxmefy/env

Usage

import env from '@naxmefy/env'
const NodeEnv: string = env('NODE_ENV', 'development')

glob method

import {glob} from '@naxmefy/env'

// e.g.:
interface IDBVars {
  DB_URL?: string
  DB_USER?: string
}

// load vars
const dbVars = glob('DB_*') as IDBVars

// e.g.:
console.log(dbVars.DB_URL)
console.log(dbVars.DB_USER)

Support for Node.js <= 4

Use Versions <= 2.x.x