Gathering detailed insights and metrics for vue-code-highlight
Gathering detailed insights and metrics for vue-code-highlight
Gathering detailed insights and metrics for vue-code-highlight
Gathering detailed insights and metrics for vue-code-highlight
@wdns/vue-code-block
Vue 3 CodeBlock - Highlight your code with ease using this syntax highlighting component powered by PrismJS or Highlight.js.
vue-highlight-component
highlight code using highlight.js and vue component.
vue-highlight-code
Import the npm package and only one prop to show highlightCode and editor
simple-code-editor
Simple code editor for Vue.js
npm install vue-code-highlight
Typescript
Module System
Node Version
NPM Version
CSS (81.39%)
JavaScript (11.22%)
Vue (5.2%)
HTML (2.2%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
124 Stars
96 Commits
21 Forks
5 Watchers
11 Branches
7 Contributors
Updated on Apr 02, 2025
Latest Version
0.7.8
Package Id
vue-code-highlight@0.7.8
Size
281.97 kB
NPM Version
7.8.0
Node Version
14.15.1
Published on
May 17, 2021
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Beautiful code syntax highlighting as Vue.js component.
https://codesandbox.io/s/vue-code-highlight-example-63h5m
npm install vue-code-highlight --save
Now, you can use this module in two diferrent ways, as a component or as a directive.
In any component:
1// You have to extract the component from the module 2import { component as VueCodeHighlight } from 'vue-code-highlight'; 3 4components:{ 5 VueCodeHighlight, 6 ... 7}
1<vue-code-highlight language="javascript"> 2 <pre> 3 //Paste your code here 4 </pre> 5</vue-code-highlight>
Props
Prop | Description |
---|---|
language | Pass language name you want to highlight. Options: https://prismjs.com/#supported-languages |
Your content will be highlighted dynamically when it updates.
The <pre>
tag is required to preserve newline characters (They're stripped by default in Vue).
Window styles are already present in a component mode, but you will need to select and include a theme to properly highlight your code. (See the themes section.)
In your main file:
1import VueCodeHighlight from 'vue-code-highlight'; 2 3Vue.use(VueCodeHighlight) //registers the v-highlight directive 4
And then in any Vue component:
1<div v-highlight > 2 ... 3</div>
All markup under the div element having the following structure will be syntax highlighted.
1<pre class="language-javascript"> 2 <code> 3 //your code goes here 4 </code> 5</pre>
To give the highlighter a window look in a directive mode, also don't forget to include the ./node_modules/vue-code-highlight/themes/window.css
file somewhere in your app.
In order to visually higlight your code, you need to select a theme from ./node_modules/vue-code-highlight/themes/
and import it somewhere into your component/application. These are just regular prism themes, so feel free to improvise.
Any of the supported languages in Prism may be used. To enable support for them, you must import them explicitly as well as Prism's markup templating.
For example, to include PHP highlighting in your application:
1import 'prism-es6/components/prism-markup-templating'; 2import 'prism-es6/components/prism-php';
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/26 approved changesets -- score normalized to 2
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
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
141 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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