This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

nconfetti

2.1.0 • Public • Published

nconfetti

nconfetti is a storage extension that support loading configuration files from folder. The folder extend the namespace of the config-files with the names of the folder and the filename without extension where the files are located.

Howto use it

'use strict';
 
const path = require('path');
 
const nconf = require('nconf');
 
require('nconfetti');
 
nconf.argv()
  .env('__');
 
nconf.use('Nconfetti', {path: path.resolve(__dirname, '../tests/configs/without_env')});
 
console.log(nconf.get('simple_config:entry'));

Try a sample

  • see samples/simple.js
  • run it with
    • npm install
    • node samples/simple.js
  • have fun

Description

After requiring nconfetti its storage will automagically be registered to nconf. Then it needs to be configured with pathand env.

The backend support dereferencing of JSON pointers with a synchronous usage of json-schema-deref

Config parameter

  • path: The path to load the config files from
  • env: Add the environment to the config path.
  • vars: A key value list of vars that will be evaluated within the config files (handlebars syntax is required)

Package Sidebar

Install

npm i nconfetti

Weekly Downloads

98

Version

2.1.0

License

MIT

Unpacked Size

8.79 kB

Total Files

9

Last publish

Collaborators

  • moellenbeck
  • obivarg