Skip to content

amritk/mjst

mjst — More JSON Schema Tools

Generate fast, type-safe TypeScript parsers, validators, and type definitions from JSON Schemas.

status license JSON Schema node bun vibe coded

Warning

mjst is pre-alpha. APIs and generated output will change without notice until 1.0.


What is mjst?

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.


Quick start

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 ./generated

Or use a config file:

npx @amritk/mjst --config ./mjst.config.json

Tip

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 -d

Then 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.


Packages

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

Requirements

  • 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.


Development

bun install
bun run test        # run the test suite
bun run check       # lint with biome
bun run build       # build all publishable packages

See .claude/architecture.md for monorepo layout and design notes, and CONTRIBUTING.md for contribution guidelines.


License

MIT

About

More JSON Schema Tools

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors