Module: config

Configuration module of npac

Methods

(static) makeConfig(defaults, cliConfig, configFileProp) → {Object}

Make one unite configuration object from the following sources:

  • built-in defaults,
  • config file content, (if exists),
  • command line config parameters
Parameters:
Name Type Description
defaults Object

The dictionary of default parameters

cliConfig Object

The dictionary of parameters parsed by the CLI

configFileProp String

The property name of the config file, if it is used at all.

Returns:
  • The configuration parameters merged into one object
Type
Object

(static) mergeConfig(config) → {function}

Create an adapter function that merges the configuration object into the context.

It returns with an npac adapter function that merges the given configuration object with the current content of the config member of the context.

Parameters:
Name Type Description
config Object

The configuration object to merge with the context.

Returns:
  • The adapter function that can be executed during the start process. It has the standard signature of adapter functions: (ctx: {Object} , next: {Function}) see also: the npac.start process description.
Type
function