Skip to content

Instantly share code, notes, and snippets.

@dweinstein dweinstein/example.md
Last active Jun 10, 2016

Embed
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');

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.