# @portabletext/toolkit

> Toolkit of handy utility functions for dealing with Portable Text

Latest version **6.0.0** (published 2026-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @portabletext/toolkit
pnpm add @portabletext/toolkit
yarn add @portabletext/toolkit
bun add @portabletext/toolkit
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-08-11 |
| First published | 2022-02-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=22.12 |
| Dependencies | 1 |
| Unpacked size | 64.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 14 |
| Author | Sanity.io |
| Maintainers | kmelve, rexxars, skogsmaskin, mariuslundgard, bjoerge, rbotten, sanity-io, snorreeb, josef-sanity, stipsan, christianhg |
| Keywords | cms, content, headless, portable-text-toolkit, realtime, sanity |

## Links

- npm: https://www.npmjs.com/package/@portabletext/toolkit
- Repository: https://github.com/portabletext/toolkit
- Homepage: https://github.com/portabletext/toolkit#readme
- Issues: https://github.com/portabletext/toolkit/issues
- npm.io page: https://npm.io/package/@portabletext/toolkit

## Dependencies (1)

- [@portabletext/types](https://npm.io/package/@portabletext/types.md) ^4.0.2

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 6.0.0 (latest) — 2026-08-11
- 3.0.3 (canary) — 2025-11-05
- 1.0.8 (legacy) — 2023-01-27
- 5.0.2 — 2026-03-04
- 5.0.1 — 2025-12-31
- 5.0.0 — 2025-12-09
- 4.0.0 — 2025-11-04
- 3.0.3-canary.0 — 2025-11-04
- 3.0.2 — 2025-11-04
- 3.0.1 — 2025-09-01
- 3.0.0 — 2025-08-21
- 2.0.18 — 2025-08-21
- 2.0.17 — 2025-02-06
- 2.0.16 — 2024-11-02
- 2.0.15 — 2024-04-11
- … 23 more at https://npm.io/package/@portabletext/toolkit/versions

## README

# @portabletext/toolkit

[![npm version](https://img.shields.io/npm/v/@portabletext/toolkit.svg?style=flat-square)](https://www.npmjs.com/package/@portabletext/toolkit)[![npm bundle size](https://img.shields.io/bundlephobia/minzip/@portabletext/toolkit?style=flat-square)](https://bundlephobia.com/result?p=@portabletext/toolkit)[![Build Status](https://img.shields.io/github/actions/workflow/status/portabletext/toolkit/main.yml?branch=main&style=flat-square)](https://github.com/portabletext/toolkit/actions?query=workflow%3Atest)

Javascript toolkit of handy utility functions for dealing with Portable Text.

Particularly useful for building rendering libraries for Portable Text that outputs HTML.

## Installation

```
npm install --save @portabletext/toolkit
```

## Documentation

See [https://portabletext.github.io/toolkit/](https://portabletext.github.io/toolkit/)

## Usage

```ts
import {toPlainText} from '@portabletext/toolkit'

console.log(toPlainText(myPortableTextBlocks))
```

## License

MIT © [Sanity.io](https://www.sanity.io/)

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