Skip to content
/ rc Public
forked from dominictarr/rc

The non-configurable configuration loader for lazy people.

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.APACHE2
Unknown
LICENSE.BSD
MIT
LICENSE.MIT
Notifications You must be signed in to change notification settings

thlorenz/rc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rc

The non-configurable configuration loader for lazy people.

Usage

The only option is to pass rc the name of your app, and your default configuration.

var rc = require('rc')(appname, {
  //defaults go here.
  port: 2468
})

Standards

Given your application name (appname), rc will look in all the obvious places for configuration.

  • command line arguments (parsed by optimist)
  • environment variables prefixed with ${appname}_
  • if you passed an option --config file then from that file
  • a local .${appname}rc or the first found looking in ./ ../ ../../ ../../../ etc.
  • $HOME/.${appname}rc
  • $HOME/.${appname}/config
  • $HOME/.config/${appname}
  • $HOME/.config/${appname}/config
  • /etc/${appname}rc
  • /etc/${appname}/config
  • the defaults object you passed in.

All configuration sources that were found will be flattened into one object, so that sources earlier in this list override later ones.

Formats

Configuration files may be in either json or ini format. Since ini, and env variables do not have a standard for types, your application needs be prepared for strings.

License

BSD / MIT / Apache2

About

The non-configurable configuration loader for lazy people.

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE.APACHE2
Unknown
LICENSE.BSD
MIT
LICENSE.MIT

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published

Languages

  • JavaScript 100.0%