Registry / devops / blueconfig

blueconfig

JSON →
library6.2.2jsnpmunverified

Blueconfig v6.2.2 is a configuration schema validator and loader for Node.js, forked from node-convict v5. It merges configs from files (JSON, YAML, JSON5, TOML, XML) and environment variables, applying schema validation with custom formats and coercion. Key differentiators: supports multiple config sources, sensitive data masking, environment variable overrides, command-line argument mapping, and custom file format parsers. Release cadence is irregular; maintained by a single developer. Active development with upcoming v7 aiming to reduce dependencies.

npm install blueconfig
INSTALL
IMPORT
SIG · BLUECONFIG
B
blueconfig
devopsjavascriptv6.2.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

blueconfig
import blueconfig from 'blueconfig'
const blueconfig = require('blueconfig').default
ESM default export. Also works with CommonJS require().
blueconfig
const blueconfig = require('blueconfig')
CommonJS usage (default export).
Schema
import type { Schema } from 'blueconfig'
import { Schema } from 'blueconfig'
Schema is a type, not a runtime value. Use type import in TypeScript.

Creates a config instance from a schema, loads a JSON file, validates, and reads a value.

import blueconfig from 'blueconfig'; const schema = { env: { doc: 'The application environment.', format: ['production', 'development', 'test'], default: 'development', env: 'NODE_ENV', }, port: { doc: 'The port to bind.', format: 'port', default: 8080, env: 'PORT', arg: 'port', }, }; const config = blueconfig(schema); config.loadFile('./config.json'); config.validate({ allowed: 'strict' }); console.log(config.get('port')); // Override via env: PORT=3000 node app.js
Debug
Known issues
breakingBlueconfig v6 drops support for Node.js <8.
fix
Upgrade to Node.js >=8 or use earlier blueconfig version.
affects: <6.0.0
gotchaUsing a format string like 'ipaddress' requires installing an external package (e.g., blueconfig-format-with-validator).
fix
Install 'blueconfig-format-with-validator' and register it: import 'blueconfig-format-with-validator';
affects: >=6.0.0
deprecatedThe 'coerce' option in schema is deprecated; use 'format' with custom coercion instead.
fix
Define a custom format that handles coercion.
affects: >=6.0.0
gotchaSensitive fields with 'sensitive: true' are still stored in memory; only masked in console output.
fix
Use environment variables and avoid logging config directly.
affects: >=6.0.0
Errors
Common errors & fixes
Error: Cannot find module 'blueconfig-format-with-validator'
Missing optional dependency for extended format validators (e.g., 'ipaddress').
fix
Run: npm install blueconfig-format-with-validator
BlueconfigError: configuration param "db.port" has invalid format: port
The 'port' format expects a number between 0 and 65535, but a string or out-of-range value was provided.
fix
Ensure the value is a valid integer port number, e.g., 8080.
TypeError: blueconfig is not a function
Using default import incorrectly in CommonJS or ES module environment.
fix
Use: const blueconfig = require('blueconfig'); (CommonJS) or import blueconfig from 'blueconfig'; (ESM).
Upgrade
Version history
6.2.2latest on npm
Audit
Dependencies
validatoroptionalUsed for format validation of certain types like email, URL, etc.
Agent activity
9 hits · last 30 days
node
8
Resources
blueconfig — npm install blueconfig · libregistry