# codemirror

> Basic configuration for the CodeMirror code editor

Latest version **6.0.2** (published 2025-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install codemirror
pnpm add codemirror
yarn add codemirror
bun add codemirror
```

## Health

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

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

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 6.0.2 |
| Published | 2025-06-19 |
| First published | 2012-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 20.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 113 |
| Author | Marijn Haverbeke |
| Maintainers | marijn |
| Keywords | editor, code |

## Links

- npm: https://www.npmjs.com/package/codemirror
- Repository: https://github.com/codemirror/basic-setup
- Homepage: https://github.com/codemirror/basic-setup#readme
- Issues: https://github.com/codemirror/basic-setup/issues
- npm.io page: https://npm.io/package/codemirror

## Dependencies (7)

- [@codemirror/lint](https://npm.io/package/@codemirror/lint.md) ^6.0.0
- [@codemirror/view](https://npm.io/package/@codemirror/view.md) ^6.0.0
- [@codemirror/state](https://npm.io/package/@codemirror/state.md) ^6.0.0
- [@codemirror/search](https://npm.io/package/@codemirror/search.md) ^6.0.0
- [@codemirror/commands](https://npm.io/package/@codemirror/commands.md) ^6.0.0
- [@codemirror/language](https://npm.io/package/@codemirror/language.md) ^6.0.0
- [@codemirror/autocomplete](https://npm.io/package/@codemirror/autocomplete.md) ^6.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.0.2 (latest) — 2025-06-19
- 5.65.21 (version5) — 2026-02-07
- 5.65.20 — 2025-08-10
- 5.65.19 — 2025-03-20
- 5.65.18 — 2024-09-20
- 5.65.17 — 2024-07-20
- 5.65.16 — 2023-11-20
- 5.65.15 — 2023-08-29
- 5.65.14 — 2023-07-17
- 5.65.13 — 2023-04-27
- 5.65.12 — 2023-02-20
- 5.65.11 — 2022-12-20
- 5.65.10 — 2022-11-20
- 5.65.9 — 2022-09-20
- 5.65.8 — 2022-08-20
- … 140 more at https://npm.io/package/codemirror/versions

## README

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

[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#codemirror) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/basic-setup/blob/main/CHANGELOG.md) ]

This package provides an example configuration for the
[CodeMirror](https://codemirror.net/) code editor. The actual editor
is implemented in the various packages under the `@codemirror` scope,
which this package depends on.

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://github.com/codemirror/basic-setup/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.

## Usage

```javascript
import {EditorView, basicSetup} from "codemirror"

const view = new EditorView({
  parent: document.body,
  doc: "Hello",
  extensions: [basicSetup /* ... */]
})
```

This sets up a basic code editor containing the word "Hello". You'll
usually want to add at least a [language
mode](https://codemirror.net/#languages) to your configuration.

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