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 1,000,000+ packages pre-installed, including confg with all npm packages installed. Try it out:

var confg = require("confg")

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

confg v0.0.5

confg helps config enviroment variables with javascript

Confg

Configurable enviroment with a js file.

npm install confg

Use

By default confg uses config.js in the root directory. This is eg. of config file.

config.js
var pkg = require('package.json');

module.exports = function( confg ){

    confg.configuration({
        APPSECRET: '2323O3IM4OIGM3OIM',
        VERSION: pkg.version,
        APPSTARTUP: ( +new Date() ) + ''
    });
};
start

to use it in you app

var confg = require( 'confg' );

confg.init( );

Config

var confg = require( 'confg' );

confg.use( __dirname + '/development.js' );
confg.init( );

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