Last active
          June 10, 2016 14:41 
        
      - 
      
- 
        Save dweinstein/8e7e7dfd57dae35367b9adc7de774066 to your computer and use it in GitHub Desktop. 
Revisions
- 
        dweinstein revised this gist Jun 10, 2016 . No changes.There are no files selected for viewing
- 
        dweinstein renamed this gist Jun 10, 2016 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ ```js // config.js const config = require('rc')('setupios', { default: 'value', @@ -9,18 +9,22 @@ const config = require('rc')('setupios', { } }); ``` ```js 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 
- 
        dweinstein created this gist Jun 10, 2016 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ ``` // 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 ```