# io-ts

> TypeScript runtime type system for IO decoding/encoding

Latest version **2.2.22** (published 2024-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install io-ts
pnpm add io-ts
yarn add io-ts
bun add io-ts
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.22 |
| Published | 2024-12-10 |
| First published | 2017-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 449.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6814 |
| Author | Giulio Canti |
| Maintainers | gcanti |
| Keywords | typescript, runtime, decoder, encoder, schema |

## Links

- npm: https://www.npmjs.com/package/io-ts
- Repository: https://github.com/gcanti/io-ts
- Issues: https://github.com/gcanti/io-ts/issues
- npm.io page: https://npm.io/package/io-ts

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 2.2.22 (latest) — 2024-12-10
- 2.0.3 (next) — 2019-12-20
- 2.2.21 — 2023-12-03
- 2.2.20 — 2022-12-03
- 2.2.19 — 2022-10-06
- 2.2.18 — 2022-08-29
- 2.2.17 — 2022-07-28
- 2.2.16 — 2021-03-08
- 2.2.15 — 2021-02-22
- 2.2.14 — 2021-02-03
- 2.2.13 — 2020-11-20
- 2.2.12 — 2020-10-28
- 2.2.11 — 2020-10-05
- 2.2.10 — 2020-08-19
- 2.2.9 — 2020-07-16
- … 106 more at https://npm.io/package/io-ts/versions

## README

[![build status](https://img.shields.io/travis/gcanti/io-ts/master.svg?style=flat-square)](https://travis-ci.org/gcanti/io-ts)
![npm downloads](https://img.shields.io/npm/dm/io-ts.svg)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Installation](#installation)
- [Usage](#usage)
  - [Stable features](#stable-features)
  - [Experimental features (version `2.2+`)](#experimental-features-version-22)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Installation

To install the stable version

```sh
npm i io-ts fp-ts
```

**Note**. [`fp-ts`](https://github.com/gcanti/fp-ts) is a peer dependency for `io-ts`

# Usage


## Stable features

- [Documentation of the main stable features (`index.ts` module)](index.md)

## Experimental modules (version `2.2+`)

Experimental modules (\*) are published in order to get early feedback from the community, see these tracking [issues](https://github.com/gcanti/io-ts/issues?q=label%3Av2.2+) for further discussions and enhancements.

The experimental modules are **independent and backward-incompatible** with stable ones.

- [`Decoder.ts` module](Decoder.md)
- [`Encoder.ts` module](Encoder.md)
- [`Codec.ts` module](Codec.md)
- [`Eq.ts` module](Eq.md)
- [`Schema.ts` module (advanced feature)](Schema.md)

(\*) A feature tagged as _Experimental_ is in a high state of flux, you're at risk of it changing without notice.

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