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 πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

@speed-highlight/core

v1.2.12

Published

🌈 Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection

Readme

Speed Highlight JS

Screenshot

  • πŸͺΆ Lightweight (~2kB for the core + ~1kB by language)
  • ⚑ Fast (faster than prism and highlight.js on average)
  • 🧹 Minimal Codebase

Simple setup πŸš€

Web

Style/theme (in the header of your html file):

<link rel="stylesheet" href="/path/dist/themes/default.css">

In the body of your html file:

<div class='shj-lang-[code-language]'>[code]</div>
or
<code class='shj-lang-[code-language]'>[inline code]</code>

Highlight the code (in your javascript):

import { highlightAll } from '/path/dist/index.js';
highlightAll();

Auto language detection

import { highlightElement } from '../dist/index.js';
import { detectLanguage } from '../dist/detect.js';

elm.textContent = code;
highlightElement(elm, detectLanguage(code));

Load custom language

import { loadLanguage } from '../dist/index.js';

loadLanguage('language-name', customLanguage);

CDN

<link rel="stylesheet" href="https://unpkg.com/@speed-highlight/core/dist/themes/default.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/speed-highlight/core/dist/themes/default.css">
import ... from 'https://unpkg.com/@speed-highlight/core/dist/index.js';
import ... from 'https://cdn.jsdelivr.net/gh/speed-highlight/core/dist/index.js';

Deno

Use the deno module

import { setTheme, printHighlight } from 'https://deno.land/x/speed_highlight_js/dist/terminal.js';

await setTheme('[theme-name]');
printHighlight('console.log("hello")', 'js');

Node

Use the npm package

npm i @speed-highlight/core
const { setTheme, printHighlight } = require('@speed-highlight/core/terminal');

setTheme('[theme-name]');
printHighlight('console.log("hello")', 'js');

Migrating from prism

Speed-highlight JS is a lighter and faster version of prism that share a similar API

Style

Remove the prism stylesheet in the head of your html file Clone this repository or use a cdn to load our stylesheet

<head>
-  <link href="themes/prism.css" rel="stylesheet" />
+  <link rel="stylesheet" href="https://unpkg.com/@speed-highlight/core/dist/themes/default.css">
</head>

Script

For the script part remove the prism.js script and replace it by a import and a call to highlightAll

<body>
-  <script src="prism.js"></script>
+<script>
+  import { highlightAll } from 'https://unpkg.com/@speed-highlight/core/dist/index.js';
+  highlightAll();
+</script>
</body>

If you want to highlight only a specific element you can use the highlightElement function instead

Code block

For the code blocks replace the <pre><code> by only one <div> And use shj-lang- prefix instead of language- for the class property

-<pre><code class="language-css">p { color: red }</code></pre>
+<div class="shj-lang-css">p { color: red }</div>

And for inline code block you just have to change the class property

-<code class="language-css">p { color: red }</code>
+<code class="shj-lang-css">p { color: red }</code>

Languages supported 🌐

| Name | Class name | Support | Language detection | | ---------- | ------------------- | --------------------------------------------------- | ------------------ | | asm | shj-lang-asm | | βœ… | | bash | shj-lang-bash | | βœ… | | brainfuck | shj-lang-bf | increment, operator, print, comment | ❌ | | c | shj-lang-c | | βœ… | | css | shj-lang-css | comment, str, selector, units, function, ... | βœ… | | csv | shj-lang-csv | punctuation, ... | ❌ | | diff | shj-lang-diff | | βœ… | | docker | shj-lang-docker | | βœ… | | git | shj-lang-git | comment, insert, deleted, string, ... | ❌ | | go | shj-lang-go | | βœ… | | html | shj-lang-html | | βœ… | | http | shj-lang-http | keywork, string, punctuation, variable, version | βœ… | | ini | shj-lang-ini | | ❌ | | java | shj-lang-java | | βœ… | | javascipt | shj-lang-js | basic syntax, regex, jsdoc, json, template literals | βœ… | | jsdoc | shj-lang-jsdoc | | ❌ | | json | shj-lang-json | string, number, bool, ... | ❌ | | leanpub-md | shj-lang-leanpub-md | | ❌ | | log | shj-lang-log | number, string, comment, errors | ❌ | | lua | shj-lang-lua | | βœ… | | makefile | shj-lang-make | | βœ… | | markdown | shj-lang-md | | βœ… | | perl | shj-lang-pl | | βœ… | | plain | shj-lang-plain | | ❌ | | python | shj-lang-py | | βœ… | | regex | shj-lang-regex | count, set, ... | ❌ | | rust | shj-lang-rs | | βœ… | | sql | shj-lang-sql | number, string, function, ... | βœ… | | todo | shj-lang-todo | | ❌ | | toml | shj-lang-toml | comment, table, string, bool, variable | ❌ | | typescript | shj-lang-ts | js syntax, ts keyword, types | βœ… | | uri | shj-lang-uri | | βœ… | | xml | shj-lang-xml | | βœ… | | yaml | shj-lang-yaml | comment, numbers, variable, string, bool | ❌ |

Themes 🌈

A modern theme by default

| Name | Terminal | Web | | ------------------- | -------- | --- | | default | βœ… | βœ… | | github-dark | ❌ | βœ… | | github-light | ❌ | βœ… | | github-dim | ❌ | βœ… | | atom-dark | βœ… | βœ… | | visual-studio-dark | ❌ | βœ… |