1.0.1 • Published 7 years ago

@tww/config v1.0.1

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

@tww/config npm version

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

ParamTypeDescription
fileNameString
optionsObject
options.schemaObjectvalidation options, see https://www.npmjs.com/package/jsonschema
options.resolvePackageJsonbooleanalso include config from package.json
options.packageJsonKeyStringkey to extract config from package json. eg {version: "0.0.1", deps: {...}, myConfg: {...}} => myConfig

License

MIT © Eric Wooley