@asdsadw12312dwd2112xz/config-validate-cli
v1.0.0
Published
Validate JSON/YAML config files against JSON Schema
Maintainers
Readme
config-validate-cli
Validate JSON/YAML config files against JSON Schema.
Installation
npm install -g config-validate-cliUsage
# Validate with a custom schema
config-validate -c config.json -s schema.json
# Validate common configs (built-in schemas for package.json, tsconfig.json)
config-validate -c package.json
# Strict mode — disallow additional properties
config-validate -c config.yaml -s schema.json --strict
# JSON output for CI pipelines
config-validate -c config.json -s schema.json --json
# Verbose — list all checked fields
config-validate -c package.json --verboseOptions
| Flag | Description |
|------|-------------|
| -c, --config <path> | Path to the config file (JSON or YAML) |
| -s, --schema <path> | Path to the JSON Schema file |
| --strict | Disallow additional properties |
| --json | Output results as JSON |
| --verbose | Show all validated fields |
| -V, --version | Show version |
| -h, --help | Show help |
Built-in Schemas
When no -s flag is provided, the tool uses built-in schemas for:
package.json— validates name, version, scripts, dependenciestsconfig.json— validates compilerOptions, include, exclude
Exit Codes
0— config is valid1— config is invalid or an error occurred
License
MIT
