Gathering detailed insights and metrics for vue-codemirror-lite
Gathering detailed insights and metrics for vue-codemirror-lite
Gathering detailed insights and metrics for vue-codemirror-lite
Gathering detailed insights and metrics for vue-codemirror-lite
npm install vue-codemirror-lite
Typescript
Module System
Node Version
NPM Version
69
Supply Chain
99.3
Quality
75.4
Maintenance
100
Vulnerability
100
License
Vue (55.32%)
JavaScript (44.68%)
Total Downloads
416,533
Last Day
71
Last Week
372
Last Month
2,186
Last Year
50,915
281 Stars
24 Commits
48 Forks
9 Watching
2 Branches
4 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.4
Package Id
vue-codemirror-lite@1.0.4
Size
65.73 kB
NPM Version
4.2.0
Node Version
7.8.0
Publised On
17 Feb 2018
Cumulative downloads
Total Downloads
Last day
-9%
71
Compared to previous day
Last week
-37.8%
372
Compared to previous week
Last month
-16.1%
2,186
Compared to previous month
Last year
-41%
50,915
Compared to previous year
CodeMirror Component For Vue.js (support 1.x and 2.x).
By default (to optimise bundle size) all modes and addons are not included. To enable them, see Using Language Modes and Addons.
Live Demo: https://cnu4.github.io/vue-codemirror-lite
To run the demo locally, run
npm install && npm run dev
View demo in browser on JSFiddle
npm install vue-codemirror-lite
1// Install the plugin 2var Vue = require('vue') 3var VueCodeMirror = require('vue-codemirror-lite') 4 5Vue.use(VueCodeMirror) 6 7// Or use as component (ES6) 8import Vue from 'vue' 9import { codemirror } from 'vue-codemirror-lite' 10 11export default { 12 components: { 13 codemirror 14 } 15}
Include in the page
<script src="https://unpkg.com/vue-codemirror-lite/dist/vuecodemirror.min.js"></script>
install into vue
Vue.use(VueCodeMirror)
or use as components
Vue.component('codemirror', VueCodeMirror.codemirror)
CodeMirror itself was built into vuecodemirror.min.js
, get CodeMirror
by
window.CodeMirror = VueCodeMirror.CodeMirror
View demo in browser on JSFiddle
1 2<!-- simple --> 3<codemirror :value="code"></codemirror> 4 5<!-- simple (with bindings in Vue1.x) --> 6<codemirror :value.sync="code"></codemirror> 7 8<!-- simple (with bindings in Vue2.x) --> 9<codemirror v-model="code"></codemirror> 10 11<!-- advanced --> 12<codemirror 13 :value="code" 14 :options="editorOption" 15 ref="myEditor" 16 @change="yourCodeChangeMethod"> 17</codemirror>
1export default { 2 data () { 3 return { 4 code: 'const str = "hello world"' 5 } 6 }, 7 computed: { 8 editor() { 9 // get current editor object 10 return this.$refs.myEditor.editor 11 } 12 }, 13 mounted() { 14 // use editor object... 15 this.editor.focus() 16 console.log('this is current editor object', this.editor) 17 } 18}
value
String
the editor valueoptions
Object (newValue)
options passed to the CodeMirror instanceSee the CodeMirror Configuration for the available options.
Several language modes are included with CodeMirror.
By default (to optimise bundle size) all modes and addons are not included. To enable:
vue-codemirror-lite
vue-codemirror-lite
itself (If use browser version, you need to include necessary script file of mode and addons. View demo in browser on JSFiddle)1<template> 2 <codemirror :options="{ 3 mode: 'javascript', 4 extraKeys: {'Ctrl-Space': 'autocomplete'} 5 }"></codemirror> 6</template> 7 8<script> 9 import { codemirror } from 'vue-codemirror-lite' 10 require('codemirror/mode/javascript/javascript') 11 require('codemirror/mode/vue/vue') 12 13 require('codemirror/addon/hint/show-hint.js') 14 require('codemirror/addon/hint/show-hint.css') 15 require('codemirror/addon/hint/javascript-hint.js') 16 17 export default { 18 ... 19 } 20</script>
See the demo source which implement JavaScript and vue syntax highlighting and JavaScript hint addon.
See the CodeMirror Manual for the more modes and addons.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 3/20 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More