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 - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

bin/conf/env.js

23

conf/env.js

@@ -1,6 +0,6 @@

var env,
, nconf = require('nconf');
var nconf = require('nconf')
, path = require('path');
nconf.argv().env().file({
file: 'config/env.json'
file: path.join('conf', 'env.json')
});

@@ -10,15 +10,16 @@

if (overridingConfig != null) {
nconf.file(overridingConfig);
console.log('Found a config file to override anything in config/default.json');
if (overridingConfig !== undefined) {
nconf.file(overridingConfig);
console.log('Found a config file to override anything in conf/env.json');
}
env = process.env.NODE_ENV || 'development';
envConf = nconf.get(env);
var env = process.env.NODE_ENV || 'development',
envConf = nconf.get(env);
for (k in envConf) {
v = envConf[k];
exports[k] = v;
for (var key in envConf) {
if (envConf.hasOwnProperty(key)) {
exports[key] = envConf[key];
}
}
exports.config = env;
{
"name": "envi",
"version": "0.0.1",
"version": "0.0.2",
"description": "an nconf wrapper around conf/env.js & env.json",

@@ -11,2 +11,3 @@ "main": "bin/envi.js",

},
"keywords": ["environment", "config", "nconf", "json"],
"license": "BSD",

@@ -13,0 +14,0 @@ "dependencies": {

@@ -9,5 +9,5 @@ ## Installation

```
envi
Done. Now run 'npm install nconf -save'
☁ bin [master] ⚡ envi
Created your conf directory with env.js and env.json!
Install latest version of nconf? y or n [y]
```

@@ -17,3 +17,3 @@

You need configuration vars that are enviromentally specific. You also want them to use nconf goodness (https://github.com/flatiron/nconf).
You need configuration vars that are enviromentally specific. You also want them to use nconf goodness (https://github.com/flatiron/nconf). You want the environment to default to being development if process.env.NODE_ENV is undefined.

@@ -30,3 +30,3 @@ Running envi will give you a conf directory that looks like this:

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

@@ -33,0 +33,0 @@ ```

Sorry, the diff of this file is not supported yet

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