Generate fast, type-safe TypeScript parsers, validators, and type definitions from JSON Schemas.
Warning
mjst is pre-alpha. APIs and generated output will change without notice until 1.0.
mjst is a monorepo of code-generation tools that turn a JSON Schema (Draft 2020-12) into TypeScript:
| Output | Description |
|---|---|
| Parsers | Runtime functions that validate and coerce unknown input into typed values |
| Validators | Lightweight predicate-style validation functions |
| Type definitions | .d.ts types matching the schema, with documentation comments |
| Markdown | Reference docs derived from the schema |
The CLI (mjst) is the primary entry point; the underlying generators are also published as standalone packages.
No install required — run it directly with your favourite package runner:
# npm
npx @amritk/mjst --schema ./schema.json --outDir ./generated
# pnpm
pnpx @amritk/mjst --schema ./schema.json --outDir ./generated
# yarn
yarn dlx @amritk/mjst --schema ./schema.json --outDir ./generated
# bun
bunx @amritk/mjst --schema ./schema.json --outDir ./generatedOr use a config file:
npx @amritk/mjst --config ./mjst.config.jsonTip
If you'd rather add it to a project, install it as a dev dependency:
npm install --save-dev @amritk/mjst # or pnpm add -D / yarn add -D / bun add -dThen use the shorter mjst command in npm scripts or via npx mjst.
See the CLI README for the full flag reference and config file examples.
| Package | Description |
|---|---|
@amritk/mjst |
CLI — generates parsers, validators, and types from a schema |
@amritk/generate-parsers |
Programmatic API for parser + type generation |
@amritk/generate-validators |
Programmatic API for validator generation |
@amritk/generate-markdown |
Programmatic API for markdown documentation generation |
@amritk/helpers |
Shared runtime helpers used by generated code |
- Node.js ≥ 20 (or Bun ≥ 1.1) to run the CLI
- TypeScript ≥ 5 in your consuming project
Contributing? You'll need Bun ≥ 1.1 — it's the package manager and bundler for this repo. See CONTRIBUTING.md.
bun install
bun run test # run the test suite
bun run check # lint with biome
bun run build # build all publishable packagesSee .claude/architecture.md for monorepo layout and design notes, and CONTRIBUTING.md for contribution guidelines.