rcfile

Loads library configuration in all possible ways

MIT License

Downloads
23K
Stars
15
Committers
2

rcfile

Loads library configuration in all possible ways

Read library configurations from yaml, json, js files or from sections in package.json.

Installation

npm install --save rcfile

Usage

'use strict'
var rcfile = require('rcfile')

console.log(rcfile('eslint'))
//> { extends: 'standard',
//    rules:
//     { 'comma-dangle': [ 2, 'always-multiline' ],
//       'arrow-parens': [ 2, 'as-needed' ] } }

console.log(rcfile('travis', { configFileName: '.travis' }))
//> { language: 'node_js',
//    sudo: false,
//    node_js: [ 'v0.10', 'v4' ],
//    cache: { directories: [ 'node_modules' ] },
//    before_install: [ 'npm install -g npm@3' ],
//    install: [ 'npm install' ],
//    after_success:
//     [ 'if [[ $TRAVIS_NODE_VERSION == "v4" ]]; then npm run coveralls; fi;',
//       'if [[ $TRAVIS_NODE_VERSION == "v4" ]]; then npm run semantic-release; fi;' ] }

License

MIT © Zoltan Kochan