@naxmefy/env
env vars util
Last updated 2 years ago by naxmefy .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @naxmefy/env 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 3.0.0                                ...           latest (2 years ago)

6 Versions

  • 3.0.0                                ...           2 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (8)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |