Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

envi

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

envi

an nconf wrapper around conf/env.js & env.json

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install -g envi

Usage

envi

Done. Now run 'npm install nconf -save'

Explanation

You need configuration vars that are enviromentally specific. You also want them to use nconf goodness (https://github.com/flatiron/nconf).

Running envi will give you a conf directory that looks like this:

conf/env.js
conf/env.json

So you can do this in your code:

env = require('./config/env');
console.log(env.hello); //outputs I'm dev by default, otherwise reads process.env.NODE_ENV

Where env.json looks like:

{
  "development":{
    "hello": "I'm dev"
  }
  , "test": {
    "hello": "I'm test"
  }
  , "staging": {
    "hello": "I'm staging"
  }
  , "production": {
    "hello": "I'm production"
  }
}

Or, leverage nconf coolness:

node myprogram.js --hello "I've been overridden"

FAQs

Package last updated on 19 Feb 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc