0.0.1 • Published 4 years ago

readinirc v0.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

readinirc

NPM Version NPM Downloads test js-standard-style

Load rc files.

Compared to other rc file loaders, this one is more focused. It does not load from cli flags, and does not support anything other than ini format.

Usage

$ npm i readinirc
const rc = require('rc-ini')

rc('my-app', (err, conf, files) => {
  if (err) {
    throw err
  }
  // Files which were loaded
  console.log(files)

  // The configuration itself
  console.log(conf)
})

CLI

$ inirc help
inirc [command] [opts]

Commands:
  inirc show [name]   print config
  inirc files [name]  print config files
  inirc               help                                                                                     [default]

Options:
  --help      Show help                                                                                        [boolean]
  --version   Show version number                                                                              [boolean]
  --cwd, -D   Directory                                                                                   [default: "."]
  --home, -h  Home                                                                          [default: "/Users/username"]
  --etc, -e   Etc                                                                                      [default: "/etc"]