Skip to content
Snippets Groups Projects
Select Git revision
  • 559ea640d86baa7014f4c9e391952859fcfb57a3
  • main default protected
  • 3-rewrite-in-typescript
  • 1.13.6
  • 1.13.5
  • 1.13.4
  • 1.13.3
  • 1.13.2
  • 1.13.1
  • 1.13.0
  • 1.12.4
  • 1.12.3
  • 1.12.2
  • 1.12.1
  • 1.12.0
  • 1.11.0
  • 1.10.1
  • 1.10.0
  • 1.9.0
  • v1.7.0
  • 1.8.0
  • v1.7.1
  • v1.6.2
23 results

config

config

pipeline status coverage report Quality Gate Status Maintainability Rating Reliability Rating Security Rating Technical Debt Vulnerabilities

Simple Config Log with HashiCorp Vault support.

Installation

npm install --save git+ssh://git@it-devops-01.br-edv.brnet.int:general/config.git

Usage

const Config = require('config')
let config = new Config()

Then config is your config object. (Use it like config.setting)

It reads from the following sources, performing a deep merge:
(The Top Value overwrites the lower ones)

  • ENV
  • config.json
  • config.defaults.json

Examples

Only config.defaults.json

node examples/only-defaults/index.js

Only config.json

(Kind of legacy use)

node examples/only-local/index.js

defaults and config.json

node examples/defaults-overwrite/index.js

enviroment variables

(Enviroment set by command to not pollute your machine)

setting=overwritten-by-env node examples/env/index.js

TODO / Missing

  • hashicorp values support: if value == "vault:", treat it as secret