# ya-json-schema-types

> TypeScript types for JSONSchema 2020-12

Latest version **2.0.2** (published 2026-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install ya-json-schema-types
pnpm add ya-json-schema-types
yarn add ya-json-schema-types
bun add ya-json-schema-types
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2026-04-07 |
| First published | 2025-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24.14.0 |
| Dependencies | 1 |
| Unpacked size | 28.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Nicolas Froidure |
| Maintainers | nfroidure |

## Links

- npm: https://www.npmjs.com/package/ya-json-schema-types
- Repository: https://github.com/nfroidure/ya-json-schema-types
- Issues: https://github.com/nfroidure/ya-json-schema-types/issues
- Funding: https://github.com/sponsors/nfroidure
- npm.io page: https://npm.io/package/ya-json-schema-types

## Dependencies (1)

- [type-fest](https://npm.io/package/type-fest.md) ^5.5.0

## Recent versions

- 2.0.2 (latest) — 2026-04-07
- 2.0.1 — 2026-04-01
- 2.0.0 — 2026-03-27
- 1.0.1 — 2025-01-28
- 1.0.0 — 2025-01-27

## README

[//]: # ( )
[//]: # (This file is automatically generated by a `metapak`)
[//]: # (module. Do not change it  except between the)
[//]: # (`content:start/end` flags, your changes would)
[//]: # (be overridden.)
[//]: # ( )
# ya-json-schema-types
> TypeScript types for JSONSchema 2020-12

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nfroidure/ya-json-schema-types/blob/main/LICENSE)


[//]: # (::contents:start)

[JSONSchema](https://json-schema.org/) 2020-12 types for TypeScript with a focus on detecting syntax errors for a better developer experience.

```ts
import { type JSONSchema } from "ya-json-schema-types";

const mySchema: JSONSchema = {
  type: "string",
};
```

Also export an alternative type for convenience allowing
to create more expressive types for clarity and
schemas that allow proper TypeScript types generation.

```ts
import { type ExpressiveJSONSchema } from "ya-json-schema-types";

// This still works
const mySchema: ExpressiveJSONSchema = {
  type: "string",
};

// This is not considered "expressive"
const myComposedSchema: ExpressiveJSONSchema = {
  $ref: "aRef",
  type: "string",
  anyof: [
    {
      const: "test",
    },
    {
      const: true,
    },
  ],
};
```


[//]: # (::contents:end)

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

# License
[MIT](https://github.com/nfroidure/ya-json-schema-types/blob/main/LICENSE)

---
_Source: https://npm.io/package/ya-json-schema-types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
