CLI tool (v2.0.0) that generates TypeScript type definitions (.d.ts) from Schema.org and compatible ontology vocabularies. Powers the schema-dts package. Processes .nt files via --ontology flag, produces complete TS types for JSON-LD structured data. Only generator in its space, actively maintained on GitHub. Requires Node >=14 and TypeScript >=4.9.5.
npm install schema-dts-genNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install and run schema-dts-gen to generate TypeScript types from Schema.org ontology, then import generated types from schema-dts.
Use import or dynamic import(). For scripts, rename to .mjs or set 'type':'module' in package.json.
Use --context-list for multiple contexts, e.g., --context-list name1:url1,name2:url2.
Run 'npm install --save-dev schema-dts' in addition to schema-dts-gen.
Convert ontology to NTriples (.nt) before passing to generator.
Upgrade Node.js to >=14 or stay on schema-dts-gen v1.x.
npm install --save-dev schema-dts-gen
Switch to import or enable ESM in your project.
Use import { run } from 'schema-dts-gen' instead of default import.npm install --save-dev schema-dts
Download ontology as .nt or convert via tools like 'rapper' or 'rdfpipe'.