basant307/AI_Governance_Project
048
1# @codemirror/view [](https://www.npmjs.org/package/@codemirror/view)2 3[ [**WEBSITE**](https://codemirror.net/) | [**DOCS**](https://codemirror.net/docs/ref/#view) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/view/src/branch/main/CHANGELOG.md) ]4 5This package implements the DOM view component for the6[CodeMirror](https://codemirror.net/) code editor.7 8The [project page](https://codemirror.net/) has more information, a9number of [examples](https://codemirror.net/examples/) and the10[documentation](https://codemirror.net/docs/).11 12This code is released under an13[MIT license](https://code.haverbeke.berlin/codemirror/view/tree/main/LICENSE).14 15We aim to be an inclusive, welcoming community. To make that explicit,16we have a [code of17conduct](http://contributor-covenant.org/version/1/1/0/) that applies18to communication around the project.19 20## Usage21 22```javascript23import {EditorView} from "@codemirror/view"24import {basicSetup} from "codemirror"25 26const view = new EditorView({27 parent: document.querySelector("#some-node"),28 doc: "Content text",29 extensions: [basicSetup /* ... */]30})31```32 33Add additional extensions, such as a [language34mode](https://codemirror.net/#languages), to configure the editor.35Call36[`view.dispatch`](https://codemirror.net/docs/ref/#view.EditorView.dispatch)37to update the editor's state.38 