@venncity/nested-config

3.1.30 • Public • Published

Coverage

Nested config

Extends the node config module to combine parent and nested packages config

Node config does not support getting configuration defined inside a npm package. It always takes the config from the config files under the working directory so configuration of packages are ignored.

This package merges the configuration defined inside npm packages into the parent config and so you can get the configuration defined inside packages seamlessly.

Usage:

Everywhere you use config in an npm package, require it like so:

const config = require('@venncity/nested-config')({ modulePath: __dirname})

NestedConfig Webpack Build Rule:

This package also includes nestedConfigBuildRule which executes similar logic to what the package does in runtime, except it runs it at build time. Then it injects the prebuiltConfigJson as a "hardcoded" parameter of bested-config:

const config = require('@venncity/nested-config')({ prebuiltConfigJson: "\{ key1: value1, key2: value2, ...\}"})

When called using the prebuiltConfigJson param, nested config does not rely on runtime filesystem structures and thus can be executed from a webpack bundle.

Readme

Keywords

none

Package Sidebar

Install

npm i @venncity/nested-config

Weekly Downloads

521

Version

3.1.30

License

none

Unpacked Size

42 kB

Total Files

13

Last publish

Collaborators

  • venncity-admin