json2ts
brew install json2ts
v15.0.4
MIT
Compile JSONSchema to TypeScript type declarations
19
30-day installs · #6881
53
90-day · #7182
306
365-day · #6269
3.3k
★ GitHub stars · updated 11mo ago
Runtime dependencies
GitHub topics
json-schema
typescript
Links
- https://github.com/bcherny/json-schema-to-typescript
- GitHub: bcherny/json-schema-to-typescript
- Brew formula source: Formula/j/json2ts.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [
"node"
],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Compile JSONSchema to TypeScript type declarations",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:39:05+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "json2ts",
"github_default_branch": "master",
"github_last_commit_at": "2025-09-25T21:34:05Z",
"github_readme_excerpt": "# json-schema-to-typescript [![Build Status][build]](https://github.com/bcherny/json-schema-to-typescript/actions?query=branch%3Amaster+workflow%3ACI) [![npm]](https://www.npmjs.com/package/json-schema-to-typescript) [![mit]](https://opensource.org/licenses/MIT) ![node]\n\n[build]: https://img.shields.io/github/actions/workflow/status/bcherny/json-schema-to-typescript/ci.yml?style=flat-square\n[npm]: https://img.shields.io/npm/v/json-schema-to-typescript.svg?style=flat-square\n[mit]: https://img.shields.io/npm/l/json-schema-to-typescript.svg?style=flat-square\n[node]: https://img.shields.io/badge/Node.js-16+-417e37?style=flat-square\n\n\u003e Compile JSON Schema to TypeScript typings.\n\n## Example\n\nCheck out the [live demo](https://borischerny.com/json-schema-to-typescript-browser/).\n\nInput:\n\n```json\n{\n \"title\": \"Example Schema\",\n \"type\": \"object\",\n \"properties\": {\n \"firstName\": {\n \"type\": \"string\"\n },\n \"lastName\": {\n \"type\": \"string\"\n },\n \"age\": {\n \"description\": \"Age in years\",\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"hairColor\": {\n \"enum\": [\"black\", \"brown\", \"blue\"],\n \"type\": \"string\"\n }\n },\n \"additionalProperties\": false,\n \"required\": [\"firstName\", \"lastName\"]\n}\n```\n\nOutput:\n\n```ts\nexport interface ExampleSchema {\n firstName: string;\n lastName: string;\n /**\n * Age in years\n */\n age?: number;\n hairColor?: \"black\" | \"brown\" | \"blue\";\n}\n```\n\n## Installation\n\n```sh\nnpm install json-schema-to-typescript\n```\n\n## Usage\n\njson-schema-to-typescript is easy to use via the CLI, or programmatically.\n\n### CLI\n\nFirst make the CLI available using one of the following options:\n\n```sh\n# install locally, then use `npx json2ts`\nnpm install json-schema-to-typescript\n\n# or install globally, then use `json2ts`\nnpm install json-schema-to-typescript --global\n\n# or install to npm cache, then use `npx --package=json-schema-to-typescript json2ts`\n# (you don\u0027t need to run an install command first)\n```\n\nThen, use the CLI to convert ",
"github_repo": "bcherny/json-schema-to-typescript",
"github_stars": 3305,
"github_topics": [
"json-schema",
"typescript"
],
"homepage": "https://github.com/bcherny/json-schema-to-typescript",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 19,
"installs_365d": 306,
"installs_90d": 53,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "MIT",
"llm_generated_at": null,
"llm_model": null,
"name": "json2ts",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 6881,
"rank_365d": 6269,
"rank_90d": 7182,
"raw_hash": "6e972bc4b1f1cd90",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/j/json2ts.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": null,
"version_stable": "15.0.4",
"versioned_formulae": [],
"why_use_this": null
}