1.0.0 • Published 8 years ago

get-rc v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

get-rc

easily load runtime configuration files

Build Status

screen shot 2016-08-03 at 12 32 57

Usage

setConfigName(name)

  • name {String}

Sets the name of the config file we're looking for. You only have to call this once.

setConfigName('.foorc')  

getConfig(path)

  • path {String} - defaults to process.cwd()

Synchronously loads config files specified in setConfigName in each level of the path. Configs are merged together with the most local to path taking precedence. Also checks the user's HOME directory. An object will always be returned, even if no config is found or there are problems parsing one or more of them.

const config = getConfig('/foo/bar/baz');

kickstarted by npm-boom