Skip to content

Instantly share code, notes, and snippets.

Last active June 10, 2016 14:41
What would you like to do?
configuration / CLI options via RC or env node.js
// config.js
const config = require('rc')('setupios', {
  default: 'value',
  other: {
     thing: 'blah'
module.exports = config;
// index.js
'use strict';

const cfg = require('./config');


which allows overriding the config via ENV and CLI as well:

node index.js --default foo --other.value ok


setupios_default=foo setupios_thing__blah=blah2 node index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment