Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@nodulus/singleton

nodulusteam4ISC1.0.0

configuration component for nodulus.

readme

@nodulus/config

configuration component for nodulus.

NPM

Alt text Alt text

install

npm install @nodulus/config

usage

 var config=require("@nodulus/config").config;
 var consts=require("@nodulus/config").consts;

 var settings = config.appSettings;

config file format

 {
  "name": "nodulus",
  "url": "",
  "port": "4000",
  "appRoot": "/",
  "enableSockets": true,
  "database": {
    "mongodb": {
      "useObjectId": true,
      "host": "---mongo url---"
    }
    ||
    { "diskdb": { "host": "server/data" } }
  }
}

set config file location

 SET CONFIG_PATH = '--config--path--'

config object api

persistConfiguration()

persistModules()

mergeConfiguration(configuration_to_merge: any, key: string)