// config.js
const config = require('rc')('setupios', {
default: 'value',
other: {
thing: 'blah'
}
});
module.exports = config;
// index.js
'use strict';
const cfg = require('./config');
console.log(cfg);
which allows overriding the config via ENV and CLI as well:
node index.js --default foo --other.value ok
and
setupios_default=foo setupios_thing__blah=blah2 node index.js