# 使用 Homebrew, Nix 安装 json2ts

查看 json2ts 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:json2ts
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install json2ts
```

  证据: local Homebrew formula metadata

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#json2ts
```

  证据: nixpkgs package indexes: pkgs/by-name/js/json2ts/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:json2ts
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/json2ts>
- **版本:** 15.0.4
- **来源摘要:** Compile JSONSchema to TypeScript type declarations
- **主页:** <https://github.com/bcherny/json-schema-to-typescript>
- **仓库:** <https://github.com/bcherny/json-schema-to-typescript>
- **许可证:** MIT
- **源码归档:** <https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-15.0.4.tgz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- json2ts (cli)
- json2ts (别名)

## 依赖

- node

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 15.0.4
- 本地数据: OK
- 上游仓库: https://github.com/bcherny/json-schema-to-typescript
- 信息: No package-manager update timestamp was available.
- 信息: No cached GitHub release or tag data was available.
## 项目历史与用法

json-schema-to-typescript is a TypeScript and Node.js code-generation tool that compiles JSON Schema documents into TypeScript declaration files. The Homebrew package is named json2ts after its command-line executable.

### 项目历史

Boris Cherny's repository was created in March 2016, and the npm package metadata records the first `0.1.0` publication on March 31, 2016. The project appeared as TypeScript was becoming a common way to describe JavaScript APIs while JSON Schema remained a common contract format for data validation.

The package evolved from a CLI into both a CLI and programmatic API. Its README documents `json2ts` usage for stdin, files, directories, globbed schema trees, YAML input, and library calls such as `compile` and `compileFromFile`.

### 采用历史

The repository had thousands of GitHub stars by 2026 and the npm registry recorded more than one hundred published versions. Its adoption came from teams that already had JSON Schema contracts and wanted generated `.d.ts` files rather than hand-maintained TypeScript interfaces.

### 使用方式

The common package-manager path is to install the Node package or Homebrew formula, then run `json2ts` to transform JSON or YAML schemas into TypeScript declarations. It can also be embedded in build scripts through the JavaScript API.

### 为什么软件包爱好者会关心

json2ts is package-nerd notable because it is a bridge between schema-first JSON tooling and TypeScript's static type ecosystem. It shows how a Node package can become a CLI distributed through npm and system package managers when the executable is useful outside JavaScript projects.

### 时间线

- 2016-03-22: The GitHub repository was created.
- 2016-03-31: npm recorded version 0.1.0 for `json-schema-to-typescript`.
- 2016-07-22: npm recorded version 1.0.0.
- 2025-01-14: npm metadata showed package modification after many published versions.

### Related projects

- The project is related to JSON Schema, TypeScript declaration generation, `typescript-json-schema` for the reverse direction, and schema-aware API tooling that uses JSON Schema as the source of truth.

### 来源

- <https://formulae.brew.sh/formula/json2ts>
- <https://github.com/bcherny/json-schema-to-typescript>
- <https://github.com/bcherny/json-schema-to-typescript/blob/master/package.json>
- <https://registry.npmjs.org/json-schema-to-typescript>
- <https://www.npmjs.com/package/json-schema-to-typescript>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** json2ts
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Nix - json2ts: normalized package name match | nixpkgs package indexes: pkgs/by-name/js/json2ts/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [node](https://pkg.so/zh-hans/brew/node/) - Runtime dependency declared by Homebrew.
- [quicktype](https://pkg.so/zh-hans/brew/quicktype/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, json-schema.
- [plank](https://pkg.so/zh-hans/brew/plank/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools, json-schema.
- [sourcery](https://pkg.so/zh-hans/brew/sourcery/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools.
- [mockolo](https://pkg.so/zh-hans/brew/mockolo/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools.
- [openapi-generator](https://pkg.so/zh-hans/brew/openapi-generator/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools.
- [mockery](https://pkg.so/zh-hans/brew/mockery/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools.
- [rswift](https://pkg.so/zh-hans/brew/rswift/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools.
- [protoc-gen-go-grpc](https://pkg.so/zh-hans/brew/protoc-gen-go-grpc/) - Shares pkgdb curated category or tags: cli, code-generation, developer-tools.
- [typescript-json-schema](https://pkg.so/zh-hans/npm/typescript-json-schema/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, code, code-generation, developer, developer-tools.
- [ts-json-schema-generator](https://pkg.so/zh-hans/npm/ts-json-schema-generator/) - Both packages work with overlapping file formats or content types. Shared terms: cli, code, code-generation, developer, developer-tools.
- [prismic-ts-codegen](https://pkg.so/zh-hans/npm/prismic-ts-codegen/) - Both packages touch the same language runtime or ecosystem. Shared terms: cli, code, code-generation, developer, developer-tools.

## Combined YAML source

View the package source record on GitHub. [combined/json2ts.yml](https://github.com/mxcl/pkgdb/blob/main/combined/json2ts.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
