Registry / developer-tools / schema-ast

schema-ast

JSON →
library2.0.0jsnpmunverified

A package providing helper utilities for working with JSON Schema abstract syntax trees (ASTs). Version 2.0.0, last updated and maintained sporadically. It offers functions to parse, transform, and generate JSON Schema documents. Differentiates from other JSON Schema libraries by focusing on low-level AST manipulation rather than validation or code generation. The package is minimal and intended for developers building tooling around JSON Schema. However, it lacks documentation and examples, and appears to be in early or incomplete state.

npm install schema-ast
INSTALL
IMPORT
SIG · SCHEMA-AST
S
schema-ast
developer-toolsjavascriptv2.0.0
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.

schemaAst
const schemaAst = require('schema-ast');
import schemaAst from 'schema-ast';
This package does not provide an ESM export; use CommonJS require.
parse
const { parse } = require('schema-ast');
const parse = require('schema-ast').parse;
Named export available via destructuring.

Shows how to parse a JSON Schema object into an AST using the parse function.

const { parse } = require('schema-ast'); const schema = { "type": "object", "properties": { "name": { "type": "string" } } }; const ast = parse(schema); console.log(JSON.stringify(ast, null, 2)); // Output: AST representation of the schema
Debug
Known issues
gotchaPackage is poorly documented; examples in README are incomplete (TODO placeholders).
fix
Refer to the source code on GitHub for API usage.
affects: >=2.0.0
breakingVersion 2.0.0 may have breaking changes from earlier versions, but no changelog is provided.
fix
Check the GitHub repository for any migration notes.
affects: 2.0.0
Errors
Common errors & fixes
Cannot find module 'schema-ast'
Package not installed or not in node_modules.
fix
Run `npm install schema-ast`.
TypeError: schemaAst is not a function
Attempting to call the default export directly, but the package exports an object with methods.
fix
Use a named export like `const { parse } = require('schema-ast');`
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
schema-ast — npm install schema-ast · libregistry