@naxmefy/env
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

@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')
const aNumber: number = env('A_NUMBER', '10', Number)
const hello: string = env('USERNAME', 'John', v => `Hello ${v}!`)

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 1.x.x

Support for Node.js 5.x

Use Versions 2.x.x

Readme

Keywords

none

Package Sidebar

Install

npm i @naxmefy/env

Weekly Downloads

0

Version

3.0.1

License

MIT

Unpacked Size

11.3 kB

Total Files

15

Last publish

Collaborators

  • naxmefy