Confidence is a configuration management library that provides a structured document format and an API for serving dynamic configuration values. It builds upon standard JSON objects, introducing special `$`-prefixed keys for filtering values based on defined criteria, facilitating environment-specific configurations, A/B testing, and dynamic value selection. The current stable version is 5.0.1, which requires Node.js v12 or higher; older Node.js environments (pre-v12) must use version 4.x. The project is actively maintained, with releases primarily driven by bug fixes, feature enhancements, and Node.js compatibility updates. Its key differentiators include built-in support for environment variables, criteria-based filtering, value ranges for A/B testing, and metadata attachment, making it a robust solution for complex application configurations.
npm install confidenceVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing a Confidence Store, retrieving configuration values with and without criteria, and showcases environment variable integration.
Upgrade Node.js to v12 or higher, or explicitly install `confidence@4` for older Node.js environments (`npm install confidence@4`).
Update import statements to use ES Modules syntax (`import { Store } from 'confidence';`). For CJS-only projects, consider using dynamic `import()` or stick to `confidence@4`.Avoid using `$` as a prefix for your own configuration data keys. Restrict custom keys to alphanumeric characters and underscores.
Change `const { Store } = require('confidence');` to `import { Store } from 'confidence';` and ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`). For CJS-only projects, install `confidence@4`.Ensure `new Store(document)` is called with a valid JSON-like object before attempting to access methods like `get` or `meta`. Check the `document` for syntax errors.
No dependency data recorded yet.