Registry / devops / base-config-schema

base-config-schema

JSON →
library0.1.24jsnpmunverified

Schema for the base-config plugin that normalizes config values before passing them to config.process(). Version 0.1.24. Part of the node-base ecosystem by Jon Schlinkert, this package validates and normalizes configuration objects according to predefined field definitions (e.g., asyncHelpers, disable, enable). It is typically used with base-config and base applications. The library is stable but receives infrequent updates. Key differentiator: it provides structured schema validation for base plugins, ensuring config data conforms to expected types and formats.

npm install base-config-schema
INSTALL
IMPORT
SIG · BASE-CONFIG-SCHEMA
B
base-config-schema
devopsjavascriptv0.1.24
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.

configSchema
var configSchema = require('base-config-schema');
import configSchema from 'base-config-schema';
Package uses CommonJS; no default export, must use require(). ESM import will fail.

Demonstrates how to create a base app, use base-config plugin, get schema, normalize config from package.json, and process it.

var Base = require('base'); var config = require('base-config'); var configSchema = require('base-config-schema'); var app = new Base(); app.use(config()); var schema = configSchema(app); var pkg = require('./package'); var obj = schema.normalize(pkg.verb); app.config.process(obj, function(err) { if (err) throw err; });
Debug
Known issues
gotchaMust call configSchema(app) after app.use(config()) to get a properly configured schema instance.
fix
Ensure app.use(config()) is called before configSchema(app).
affects: >=0.1.0
deprecatedThe package is part of the deprecated 'base' framework. New projects should use modern alternatives.
fix
Consider using a generic schema validator like Joi or Yup instead.
affects: >=0.1.0
gotchaThe schema.normalize() method expects an object and may throw if passed null or undefined.
fix
Always pass a valid object, even if empty: schema.normalize({}).
affects: >=0.1.0
gotchaThe package does not export TypeScript types; developers must create type definitions manually.
fix
Use // @ts-ignore or write custom .d.ts file.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'base-config-schema'
Package not installed or incorrect import path.
fix
Run 'npm install base-config-schema' and ensure require path is correct.
configSchema is not a function
configSchema(app) called before app.use(config()) or incorrect require.
fix
Ensure base-config is installed and app.use(config()) is invoked before configSchema(app).
TypeError: Cannot read property 'normalize' of undefined
configSchema(app) returned undefined because app lacks config plugin.
fix
Add app.use(config()) before calling configSchema(app).
Upgrade
Version history
0.1.24latest on npm
Audit
Dependencies
base-configrequiredRequired to use the schema with config.process()
Agent activity
9 hits · last 30 days
node
8
Resources
base-config-schema — npm install base-config-schema · libregistry