New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

confi

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

confi - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

7

History.md
0.5.0 / 2015-03-18
==================
* Merge pull request #9 from firstandthird/feature/default-helper
* Switched to handlebars to support default value helper.
0.4.0 / 2015-03-18

@@ -3,0 +10,0 @@ ==================

12

lib/confi.js

@@ -9,3 +9,3 @@ var fs = require('fs');

var glob = require('glob');
var Mustache = require('mustache');
var Handlebars = require('handlebars');

@@ -50,4 +50,12 @@ var defaults = {

config = JSON.parse(Mustache.render(JSON.stringify(config), config));
Handlebars.registerHelper('default', function(value, defaultVal) {
if (typeof value === 'undefined') {
value = defaultVal;
}
return new Handlebars.SafeString(value);
});
config = JSON.parse(Handlebars.compile(JSON.stringify(config))(config));
return config;

@@ -54,0 +62,0 @@ };

6

package.json
{
"name": "confi",
"description": "a simple configuration library",
"version": "0.4.0",
"version": "0.5.0",
"homepage": "https://github.com/firstandthird/confi",

@@ -15,4 +15,4 @@ "author": "First+Third",

"glob": "^5.0.3",
"js-yaml": "~2.0.5",
"mustache": "^1.1.0"
"handlebars": "^3.0.0",
"js-yaml": "~2.0.5"
},

@@ -19,0 +19,0 @@ "devDependencies": {

{
"isTest": true,
"testHost": "{{host}}/test/path"
"testHost": "{{host}}/test/path",
"testDefault": "{{default ENV.invalid 123456}}",
"testDefault2": "{{default host 'nope'}}"
}

@@ -24,2 +24,4 @@ var confi = require('../');

t.equal(config.ENV.testEnv, 'test');
t.equal(config.testDefault, '123456');
t.equal(config.testDefault2, 'localhost');
t.equal(config.env, 'dev');

@@ -26,0 +28,0 @@ t.done();

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