Skip to content

reergymerej/get-rc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get-rc

easily load runtime configuration files

Build Status

screen shot 2016-08-03 at 12 32 57

Installation

npm i get-rc

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

About

easily load runtime configuration files

Resources

Stars

Watchers

Forks

Packages

No packages published