1.0.0 • Published 5 years ago

@ominestre/config-reader v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Config Reader

Build Status

Node module for reading JSON or YAML config and returning a Plain Ol' JavaScript Object.

Contributing

Reference CONTRIBUTING.md for instructions on how to contribute to this project.

Usage

configReader.getConfig( String )

const configReader = require('@ominestre/config-reader');
const config = configReader.getConfig('/path/to/my/config.json');

The string should preferrably be an absolute path to your configuration file. This module will attempt to resolve a relative path to your current working directory but that should be considered volatile.

It will throw an exception if you point to a file that isn't of extension .json, .yml, or .yaml. It will also throw an exception if your path can't be resolved or if the file can't be read.