Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol
diffdown.com
1# codemirror [](https://www.npmjs.org/package/codemirror)
2
3[ [**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) ]
4
5This package provides an example configuration for the
6[CodeMirror](https://codemirror.net/) code editor. The actual editor
7is implemented in the various packages under the `@codemirror` scope,
8which this package depends on.
9
10The [project page](https://codemirror.net/) has more information, a
11number of [examples](https://codemirror.net/examples/) and the
12[documentation](https://codemirror.net/docs/).
13
14This code is released under an
15[MIT license](https://github.com/codemirror/basic-setup/tree/main/LICENSE).
16
17We aim to be an inclusive, welcoming community. To make that explicit,
18we have a [code of
19conduct](http://contributor-covenant.org/version/1/1/0/) that applies
20to communication around the project.
21
22## Usage
23
24```javascript
25import {EditorView, basicSetup} from "codemirror"
26
27const view = new EditorView({
28 parent: document.body,
29 doc: "Hello",
30 extensions: [basicSetup /* ... */]
31})
32```
33
34This sets up a basic code editor containing the word "Hello". You'll
35usually want to add at least a [language
36mode](https://codemirror.net/#languages) to your configuration.