Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including configjson with all npm packages installed. Try it out:

var configjson = require("configjson")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

configjson v0.0.5

Wrapper to configuration in CJSON

Configuration cjson

Is a wrapper for configuration with CJSON.

How to use it:

var config = require('configjson');
var myConfig = new config([
    'file1.json',
    'file2.json',
], {
    "hello" : ":)"
});

Make a call the variables.

myConfig.get(name);
myConfig.set(obj);
myConfig.set(name, val);
myconfig.enable(name);
myconfig.disable(name);
myconfig.enabled(name);
myconfig.disabled(name);

Make configurable

myConfig.configure("test", function(){
    // Only run in Test
});

myconfig.configure("production", function(){
    // Only run in Production
});

myconfig.configure(function(){
    // Run in All
});

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free