@tww/config
Specify a config file name, and search up the directory tree for matching JSON files. Combining them into a config object.
Installation
$ npm install --save @tww/config
Usage
var {resolveConfig} = require('@tww/config');
const config = resolveConfig('.my-project-config');
API
module.exports.resolveConfig(fileName, options)
Resolves config files, parses and combines them with priority to the nearest file
Kind: global function
Param | Type | Description |
---|---|---|
fileName | String |
|
options | Object |
|
options.schema | Object |
validation options, see https://www.npmjs.com/package/jsonschema |
options.resolvePackageJson | boolean |
also include config from package.json |
options.packageJsonKey | String |
key to extract config from package json. eg {version: "0.0.1", deps: {...}, myConfg: {...}} => myConfig |
License
MIT © Eric Wooley