No description or website provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
example
test
.gitignore
.npmignore
.travis.yml
README.md
index.js
package.json

README.md

simpler-config

A really simple config library.

travis npm standard

Installation:

npm i simpler-config --save

A few examples:

// require the library and then call load once with an object to setup your config.

// You can use a JS file (don't forget module.exports)
const config = require('simpler-config').load(require('./config'))

// or a JSON file
const config = require('simpler-config').load(require('./config.json'))

// or an object
const config = require('simpler-config').load({someKey: 'Some Value'}))

// or something far too fancy
const config = require('simpler-config').load({
    dev: require('./dev'),
    staging: require('./staging'),
    production: require('./production')
}[process.env.name])

// Right. You get the idea.

// meanwhile, in another file in a directory far far away
const config = require('simpler-config')
console.log(config.someKey)

Here's another example as well.