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

confide

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

confide - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

confide.js

@@ -6,3 +6,4 @@ 'use strict';

_ = require('underscore'),
async = require('async');
async = require('async'),
deepExtend = require('deep-extend');

@@ -89,3 +90,3 @@ /**

var envConfig = configHash[env];
var mergedConfig = _.defaults(envConfig, defaultConfig);
var mergedConfig = deepExtend({}, defaultConfig, envConfig);
cb(null, mergedConfig);

@@ -92,0 +93,0 @@ }

8

package.json
{
"name": "confide",
"version": "1.0.0",
"version": "1.1.0",
"description": "simple app configuration",
"contributors": ["Nicholas Cloud <ncloud@appendto.com>"],
"keywords": ["configuration", "config"],
"license": "MIT",
"license": "LICENSE",
"main": "confide.js",

@@ -15,3 +15,4 @@ "repository": {

"underscore": "latest",
"async": "latest"
"async": "latest",
"deep-extend": "latest"
},

@@ -26,3 +27,2 @@ "devDependencies": {

}
}

@@ -56,2 +56,21 @@ /*global suite, test, setup, teardown*/

test('should load merged environment at multiple levels (deep extend)', function (done) {
var config = confide({configDir: CONFIG_DIR});
config.load('development', function (err, mergedConfig) {
var level;
assert.property(mergedConfig, 'level1'); //default & development
assert.isObject(mergedConfig.level1);
level = mergedConfig.level1;
assert.property(level, 'atLevel1'); //development
assert.isTrue(level.atLevel1);
assert.property(level, 'level2'); //default & development
assert.isObject(level.level2);
level = level.level2;
assert.property(level, 'atLevel2'); //development
assert.property(level, 'level3'); //default
assert.isTrue(level.level3); //default
done();
});
});
test('should err if no default environment specified, and env parameter absent', function (done) {

@@ -58,0 +77,0 @@ var config = confide({configDir: CONFIG_DIR, defaultEnv: ''});

{
"configName": "default",
"defaultOnly": true
"defaultOnly": true,
"level1": {
"level2": {
"level3": true
}
}
}
{
"configName": "development",
"developmentOnly": true
"developmentOnly": true,
"level1": {
"atLevel1": true,
"level2": {
"atLevel2": true
}
}
}
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