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

hexo-highlight-shiki

v2.1.0

Published

A hexo plugin adds shiki highlight support

Readme

Hexo Highlight Shiki

The latest version (v2.0.0+) is using latest shiki (v3.2.1+), and is esm only. This requires node >= 20.19.0 || >= 22.12.0 which supports require(esm).

Use shiki as code block highlighter instead of builtin highlight.js or prism.js.

Installation

Install this package with your favorite package manager.

# pnpm
pnpm add hexo-highlight-shiki

# npm
npm add hexo-highlight-shiki

# yarn
yarn add hexo-highlight-shiki

# bun
bun add hexo-highlight-shiki

Hexo Configuration

In hexo configuraion file _config.yml, you should find a syntax_highlighter field, set it to shiki.

syntax_highlighter: "shiki"

Also, set highlight and prismjs to false to disable them.

highlight: false
prismjs: false

Shiki Configuration

Simple Configuration

Add a shiki field in hexo configuration file _config.yml, and set the theme field to the theme you want to use.

shiki:
  theme: "github-light"

Dark Mode

Shiki supports dark mode now.

shiki:
   themes:
      dark: "github-dark"
      light: "github-light"

For more configuration options, see Custom Dark Mode and Custom Theme.

Advanced Configuration

Custom Language

Shiki supports custom languages. You can add a languages field in shiki configs, and set the name and path fields.

shiki:
  languages:
    - name: "custom"
      path: "path/to/custom.tmLanguage.json"

If your site only needs to highlight your custom language, you can set loadAllLanguages to false to disable loading all languages. See Load languages on demand for more details.

shiki:
  loadAllLanguages: false

Load languages on demand

Due to the restriction of hexo, this plugin uses shiki highlighter instance to highlight code synchronously.

Shiki highlighter instance only loads the languages you need, so you can add a loadLanguages field in shiki configs, and set the languages you want to load.

By default, this plugin will load all languages, which is pretty slow. You can list languages you need in language field and set loadLanguages to false to disable it.

shiki:
  languages:
    - javascript
    - html
    - css
  loadLanguages: false

Custom Dark Mode

By default, this plugin will use query selector to change the theme based on the system dark mode. You can set autoInjectCSS to class (default is query) to use class selector instead.

The default selector is html.dark. You can change it by darkSelector field.

shiki:
   autoInjectCSS: "class"
   darkSelector: "html.dark"

Custom Theme

You can use your custom theme by not using string, but an object with name and path fields.

The path should point to a textMate theme json file

shiki:
  theme:
    name: "custom"
    path: "path/to/custom.json"
shiki:
   themes:
      dark:
         name: "custom-dark"
         path: "path/to/custom-dark.json"
      light:
         name: "custom-light"
         path: "path/to/custom-light.json"