{"id":42526,"library":"confabulous","title":"Confabulous","description":"Confabulous is a pluggable, hierarchical, asynchronous configuration loader and post-processor for Node.js. Version 2.1.2 is the current stable release. It supports loading config from command line arguments, environment variables, JSON/JavaScript files, HTTP endpoints, Vault, etcd, and PostgreSQL. Config sources can be watched for changes, and post-processors can transform loaded data (e.g., decrypt secrets or unflatten objects). It merges configs recursively using a customizable merge strategy. Compared to alternatives like node-config or dotenv, Confabulous emphasizes async loading, hierarchical merging, and extensive source support.","status":"active","version":"2.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/guidesmiths/confabulous","tags":["javascript","configuration","loader","asynchronous","hierarchical","watch","file","environment","command"],"install":[{"cmd":"npm install confabulous","lang":"bash","label":"npm"},{"cmd":"yarn add confabulous","lang":"bash","label":"yarn"},{"cmd":"pnpm add confabulous","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for deep merging configuration objects (mergeDeepRight) and other utilities.","package":"ramda","optional":false}],"imports":[{"note":"Confabulous is a CommonJS module and does not export ESM. Use require().","wrong":"import { Confabulous } from 'confabulous'","symbol":"Confabulous","correct":"const Confabulous = require('confabulous')"},{"note":"Both destructured and dot-access work; destructuring is idiomatic.","wrong":"const loaders = require('confabulous').loaders","symbol":"loaders","correct":"const { loaders } = require('confabulous')"},{"note":"postProcessors is a named export from the CommonJS module.","wrong":"import postProcessors from 'confabulous'","symbol":"postProcessors","correct":"const { postProcessors } = require('confabulous')"}],"quickstart":{"code":"const Confabulous = require('confabulous');\nconst { loaders, postProcessors } = Confabulous;\n\nconst conf = new Confabulous()\n  .add(config => loaders.args())\n  .add(config => loaders.env())\n  .add(config => loaders.require({ path: './config/default.json' }))\n  .add(config => loaders.require({ path: './config/production.json', mandatory: false }))\n  .postProcessor(postProcessors.unflatten())\n  .end((err, config) => {\n    if (err) {\n      console.error('Failed to load config', err);\n      process.exit(1);\n    }\n    console.log('Loaded config:', config);\n    // Your application logic here\n  });","lang":"javascript","description":"Shows how to create a Confabulous instance, add loaders for args, env, and JSON files, apply a post-processor to unflatten keys, and handle the final configuration."},"warnings":[{"fix":"Replace loaders.http({...}) with loaders.https({...}).","message":"loaders.http() is deprecated in favor of loaders.https() for security reasons.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Update to Node.js >= 10 and adjust any code relying on removed callback parameters.","message":"Version 2.0 dropped support for Node.js < 10. The callback signature changed from (err, config) to (err, config) with no extra arguments.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Access the key as config.myOption, not config['my-option'].","message":"The 'args' loader parses command-line arguments using minimist. Named arguments with hyphens (--my-option) become camelCase keys (myOption).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set mandatory: false for optional sources to avoid blocking startup.","message":"If a loader defines 'mandatory: true' and the source is missing, the config loading fails with an error. This applies to loaders.require, loaders.http, loaders.https, etc.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Remove any watch: true option from require loader config; it is now the default.","message":"In version 2.1.0, the 'watch' option behavior for the 'require' loader changed: it now always watches the file instead of requiring an explicit true value.","severity":"breaking","affected_versions":">=2.1.0 <2.1.0"}],"env_vars":null,"search_vec":"'2.1.2':17 'altern':73 'argument':30 'async':82 'asynchron':7,93 'chang':47 'command':28,98 'compar':71 'confabul':1,2,80 'config':26,41,64,77 'configur':8,91 'current':20 'customiz':68 'data':55 'decrypt':57 'dotenv':79 'e.g':56 'emphas':81 'endpoint':36 'environ':31,97 'etcd':38 'extens':87 'file':34,96 'hierarch':6,84,94 'http':35 'javascript':90 'json/javascript':33 'like':74 'line':29 'load':25,54,83 'loader':9,92 'merg':63,69,85 'node':76 'node-config':75 'node.js':15 'object':61 'pluggabl':5 'post':12,50 'post-processor':11,49 'postgresql':40 'processor':13,51 'recurs':65 'releas':22 'secret':58 'sourc':42,88 'stabl':21 'strategi':70 'support':24,89 'transform':53 'unflatten':60 'use':66 'variabl':32 'vault':37 'version':16 'watch':45,95","created_at":"2026-06-05T16:55:23.959292+00:00","updated_at":"2026-06-05T16:55:23.959292+00:00","problems":[{"fix":"Run 'npm install confabulous' in your project directory.","cause":"Package not installed or installed globally.","error":"Cannot find module 'confabulous'"},{"fix":"Ensure you use 'new Confabulous()' and that your variable references the instance.","cause":"Confabulous is not instantiated with 'new' or the variable is misassigned.","error":"TypeError: confabulous.add is not a function"},{"fix":"Double-check the path passed to loaders.require() or set mandatory: false if the file is optional.","cause":"A required config file path is incorrect or file is missing.","error":"Error: ENOENT: no such file or directory, open './config.json'"},{"fix":"Use 'const { loaders } = require('confabulous');' or 'const loaders = require('confabulous').loaders;'.","cause":"loaders is not destructured correctly.","error":"TypeError: Cannot read property 'args' of undefined"},{"fix":"Replace loaders.http() with loaders.https() and update options accordingly.","cause":"Using loaders.http() which has been deprecated for security.","error":"Warning: loader 'http' is deprecated, use 'https' instead"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://guidesmiths.github.io/confabulous/","github":"https://github.com/guidesmiths/confabulous","docs":null,"changelog":null,"pypi":null,"npm":"confabulous","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}