1.3.8 • Published 4 years ago

codemirror-binder v1.3.8

Weekly downloads
8
License
MIT
Repository
github
Last release
4 years ago

codemirror-binder npm version

CodeMirror binder creator for defi.js

The binder creator returns a binder which initializes and binds CodeMirror instance (created using fromTextArea function) to a property.

Usage

npm i codemirror-binder
import { bindNode } from 'defi';
import codeMirrorBinder from 'codemirror-binder';

// ...
bindNode(obj, 'code', textarea, codeMirrorBinder());

Usage in a browser environment

For non-CJS environment the bundle can be downloaded at gh-pages branch.

In the browser environment the script exports a global variable codeMirrorBinder.

<script src="path/to/codemirror-binder.min.js"></script>

Configuration

The function accepts one argument: configuration object which is passed into the internal call of CodeMirror.fromTextArea. Read the CodeMirror documentation for more info.

bindNode(obj, 'code', textarea, codeMirror({
    lineNumbers: true,
    mode: 'htmlmixed'
}));
1.3.8

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.10

4 years ago

2.0.0

4 years ago

1.1.9

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.4

4 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

6 years ago

0.0.0-auto

6 years ago