Registry / devops / explain-json-schema

explain-json-schema

JSON →
library1.1.1jsnpmunverified

Explains JSON Schema in plain English text. Version 1.1.1 is current. Supports most JSON Schema features including allOf, oneOf, anyOf, if/then/else, and nested references. Use case: generating human-readable documentation or diffs for configurations defined by JSON Schema. Differentiator: produces natural language output rather than YAML/JSON.

npm install explain-json-schema
INSTALL
IMPORT
SIG · EXPLAIN-JSON-SCHEM
E
explain-json-schema
devopsjavascriptv1.1.1
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.

explainSchema
import { explainSchema } from 'explain-json-schema'
const { explainSchema } = require('explain-json-schema')
Package is ESM-only, so require is not supported.
explainSchema
import { explainSchema } from 'explain-json-schema'
import explainSchema from 'explain-json-schema'
export is named, not default.
default
import { explainSchema } from 'explain-json-schema'
import explain from 'explain-json-schema'
No default export exists.

Reads a JSON Schema file and outputs a natural language description of its constraints.

import { explainSchema } from 'explain-json-schema'; import { readFileSync } from 'fs'; const schema = JSON.parse(readFileSync('schema.json', 'utf8')); const explanation = explainSchema(schema); console.log(explanation);
Debug
Known issues
gotchaThe library does not support the 'dependencies' keyword for schemas (object property dependencies).
fix
Pre-process schemas to handle dependencies manually or use a different library.
affects: <=1.1.1
gotchaOutput is Markdown-formatted text; not plain English only.
fix
Strip Markdown if needed.
affects: <=1.1.1
deprecatedThe CLI usage via npx may require a global install in some environments.
fix
Use `node node_modules/.bin/explain-json-schema` if npx fails.
affects: <=1.1.1
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
The project is ESM-only, but CommonJS is expected.
fix
Add `"type": "module"` to package.json or use dynamic import.
TypeError: explainSchema is not a function
Default import attempted instead of named import.
fix
Use `import { explainSchema } from 'explain-json-schema'`.
Error: Cannot find module 'explain-json-schema'
Module not installed or wrong import path.
fix
Run `npm install explain-json-schema` and ensure import path is correct.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
explain-json-schema — npm install explain-json-schema · libregistry