config-file

Find and load a YAML or JSON config file from a local project, installed npm module, or the user's home directory.

config-file

Find and load a YAML or JSON config file from a local project, installed npm module, or the user's home directory.

npm:

npm i config-file --save

bower:

bower install config-file --save
var config = require('config-file');
config.load('.whateverrc'); // assumes JSON 
config.load('.whateverrc', {parse: 'yaml'});
config.npmLoad('foo'); // npm module name 
config.npmLoad('foo', 'package.json'); // default is package.json, can be anything 
config.npmLoad('foo', '.whatever.yml.', {parse: 'yaml'});

Jon Schlinkert

Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license