npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-highlight.js-number

v0.0.1

Published

Highlight.js syntax highlighter component for Vue.

Readme

Vue Highlight.js

license vue 2 npm npm Travis Codacy grade Gemnasium ESLint Gluons

📜 Highlight.js syntax highlighter component for Vue.

⚙️ Installation

Via NPM:

NPM

  1. Install highlight.js:

    npm install highlight.js
  2. Install Vue Highlight.js:

    npm install vue-highlight.js

Or Yarn:

  1. Install highlight.js:

    yarn add highlight.js
  2. Install Vue Highlight.js:

    yarn add vue-highlight.js

🎬 Demo

Go to https://gluons.github.io/vue-highlight.js

🛂 Usage

Main file:

import Vue from 'vue';
import VueHighlightJS from 'vue-highlight.js';
import App from './App';

/*
 * Use Vue Highlight.js
 */
Vue.use(VueHighlightJS);

/*
 * Import Highlight.js theme
 * Find more: https://highlightjs.org/static/demo/
 */
import 'highlight.js/styles/default.css';

new Vue({
	el: '#app',
	render: h => h(App)
});

Vue file:

<template>
	<div id="app">
		<!-- Code Block -->
		<highlight-code lang="javascript">
			let str = 'Hello, World!';
			console.log(str);
		</highlight-code>

		<!-- Inline Code Block -->
		<highlight-code lang="javascript" inline>alert('Hello, World!');</highlight-code>
	</div>
</template>

<script>
// JavaScript...
</script>

<style>
/* StyleSheet... */
</style>

📚 API

<highlight-code>

Highlight.js code block.

🔰 Slots

Static code content.

🔰 Properties

lang

Type: String

Highlight.js language.

inline

Type: Boolean
Default: false

Enable inline code block when set it to true.

code

Type: String

Code content in code block.

You can use this prop if you want to bind code content to your data source.
It's useful for dynamic code content.

Component will ignore slot static content if you use this.

auto

Type: Boolean

Enable auto detecting code language.

Code will be detected by highlight.js' highlightAuto function.

Component will ignore lang prop if you use this.

❓ FAQ

  • How to write HTML code inside slot?

    You have to escape all HTML tags before add it into slot.
    If you didn't do that, browser will interpret those tags as HTML element.
    ℹ️ See isagalaev/highlight.js#866

    If you use code property instead of slot, you don't need to worry about this.
    Vue Highlight.js will automatically escape it for you.

  • Why did I get SyntaxError: Unterminated template literal error when used <script></script> in code property?

    If you add </script> at anywhere inside script tag, although it's a string inside quotes, it will always close the script tag.
    ℹ️ See "Unterminated template literal" syntax error when literal contains script tag

🛣️ Roadmap on Trello