@joshnuss/svelte-codemirror

0.2.6 • Public • Published

Svelte CodeMirror component

Provides an abstraction layer over CodeMirror that reduces the setup needed to make it work with Svelte.

Demo

https://svelte.dev/repl/b2c657e8c49a42b6ba6aaf3dbd7d09d5

Usage

<script>
  import 'codemirror/mode/javascript/javascript'
  import CodeMirror from '@joshnuss/svelte-codemirror'
  
  let editor
</script>

<CodeMirror bind:editor options={{ lineNumbers: true, mode: "javascript"}} value='const x = 42'/>

License

MIT

Dependencies (0)

    Dev Dependencies (6)

    Package Sidebar

    Install

    npm i @joshnuss/svelte-codemirror

    Weekly Downloads

    46

    Version

    0.2.6

    License

    MIT*

    Unpacked Size

    822 kB

    Total Files

    9

    Last publish

    Collaborators

    • joshnuss