# @codemirror/state

> Editor state data structures for the CodeMirror code editor

Latest version **6.7.4** (published 2026-09-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @codemirror/state
pnpm add @codemirror/state
yarn add @codemirror/state
bun add @codemirror/state
```

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.7.4 |
| Published | 2026-09-04 |
| First published | 2020-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 429.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Marijn Haverbeke |
| Maintainers | marijn |
| Keywords | editor, code |

## Links

- npm: https://www.npmjs.com/package/@codemirror/state
- Repository: https://code.haverbeke.berlin/codemirror/state
- npm.io page: https://npm.io/package/@codemirror/state

## Dependencies (1)

- [@marijn/find-cluster-break](https://npm.io/package/@marijn/find-cluster-break.md) ^1.0.0

## 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

- 6.7.4 (latest) — 2026-09-04
- 6.7.3 — 2026-09-04
- 6.7.2 — 2026-08-31
- 6.7.1 — 2026-07-05
- 6.7.0 — 2026-06-23
- 6.6.0 — 2026-03-12
- 6.5.4 — 2026-01-14
- 6.5.3 — 2025-12-22
- 6.5.2 — 2025-02-03
- 6.5.1 — 2025-01-10
- 6.5.0 — 2024-12-09
- 6.4.1 — 2024-02-19
- 6.4.0 — 2023-12-28
- 6.3.3 — 2023-12-06
- 6.3.2 — 2023-11-27
- … 34 more at https://npm.io/package/@codemirror/state/versions

## README

# @codemirror/state [![NPM version](https://img.shields.io/npm/v/@codemirror/state.svg)](https://www.npmjs.org/package/@codemirror/state)

[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#state) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/state/src/branch/main/CHANGELOG.md) ]

This package implements the editor state data structures for the
[CodeMirror](https://codemirror.net/) code editor.

The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).

This code is released under an
[MIT license](https://code.haverbeke.berlin/codemirror/state/tree/main/LICENSE).

We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.

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