# @typeschema/main

> Universal adapter for schema validation

Latest version **0.14.1** (published 2024-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @typeschema/main
pnpm add @typeschema/main
yarn add @typeschema/main
bun add @typeschema/main
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.14.1 |
| Published | 2024-10-13 |
| First published | 2024-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 50.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 452 |
| Author | André Costa |
| Maintainers | decs |
| Keywords | typescript, type, schema, adapter, validation, inference, assert, arktype, class-validator, deepkit, effect, fastest-validator, function, io-ts, joi, json, ow, runtypes, superstruct, suretype, typebox, valibot, valita, vine, yup, zod |

## Links

- npm: https://www.npmjs.com/package/@typeschema/main
- Repository: https://github.com/decs/typeschema
- Homepage: https://typeschema.com
- Issues: https://github.com/decs/typeschema/issues
- npm.io page: https://npm.io/package/@typeschema/main

## Dependencies (1)

- [@typeschema/core](https://npm.io/package/@typeschema/core.md) 0.14.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.14.1 (latest) — 2024-10-13
- 0.14.0 — 2024-08-25
- 0.13.10 — 2024-06-17
- 0.13.9 — 2024-04-12
- 0.13.8 — 2024-03-16
- 0.13.7 — 2024-03-02
- 0.13.6 — 2024-03-01
- 0.13.5 — 2024-02-27
- 0.13.4 — 2024-02-27
- 0.13.3 — 2024-02-25
- 0.13.2 — 2024-02-23
- 0.13.1 — 2024-02-23
- 0.13.0 — 2024-02-22

## README

<!-- This file is generated. Do not modify it manually! -->

<img src="https://typeschema.com/assets/logo.png" width="64px" alt="TypeSchema" />
<h1>@typeschema/main</h1>
<p>
  <a href="https://opensource.org/licenses/MIT" rel="nofollow"><img src="https://img.shields.io/github/license/decs/typeschema" alt="License"></a>
  <a href="https://bundlephobia.com/package/@typeschema/main" rel="nofollow"><img src="https://img.shields.io/bundlephobia/minzip/%40typeschema%2Fmain" alt="Bundle size"></a>
  <a href="https://www.npmjs.com/package/@typeschema/main" rel="nofollow"><img src="https://img.shields.io/npm/dw/@typeschema/main.svg" alt="npm downloads"></a>
  <a href="https://github.com/decs/typeschema/stargazers" rel="nofollow"><img src="https://img.shields.io/github/stars/decs/typeschema" alt="GitHub stars"></a>
</p>
<p>
  Universal adapter for schema validation
  <br />
  <a href="https://typeschema.com">https://typeschema.com</a> ✨
</p>

## API

### Inference
- `Infer<TSchema>`: Extracts the output type of a schema
- `InferIn<TSchema>`: Extracts the input type of a schema

### Validation
- `wrap(schema)`: Returns the wrapped schema with access to its operations
- `validate(schema, data)`: Returns the validated data or a list of validation issues
- `assert(schema, data)`: Returns the validated data or throws an `AggregateError`

### Serialization
- `toJSONSchema(schema)`: Converts the schema into the equivalent JSON schema

---
_Source: https://npm.io/package/@typeschema/main · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
