0.3.0 • Published 7 years ago

first-conf v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Semver Build Status

First-Conf

first-conf returns a configuration object from a file in a directory list.

Installation

npm -i first-conf

Basic usage

This example assumes that you have my-config.json in on of directories in the list.

const FirstConf = require('first-conf')

const config = FirstConf.get('my-config.json', {
  directories: [
    '/etc',
    process.cwd()
  ]
})

console.log(config)

A more complete example are shown here

API

  • get(filename, [options], [default]) returns an object containing configuration where: - filename: the name of the file where configurations are stored.

    > Currently first-conf only supports JSON configuration files.
    
    - `options`: An object containing options that control the behavior of **first-conf**.
        - `directories`: an array containing a list of directory where **first-conf** will search the configuration file.

Contributing

If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue or a pull request with a fix.

Licence

This project is licensed under the MIT License - see the LICENSE file for details.

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.0-dev.0

7 years ago