New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@pierre/highlights

Package Overview
Dependencies
Maintainers
7
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pierre/highlights

A fast code highlighter written in WebAssembly Text(Wat), from Pierre

npmnpm
Version
0.0.5
Version published
Weekly downloads
1.1K
-56.16%
Maintainers
7
Weekly downloads
 
Created
Source

Highlights, from Pierre

@pierre/highlights is a syntax highlighter written in WebAssembly Text (WAT), with 73 built-in languages and Zed-compatible themes. It generates HTML or themed tokens and supports streaming input and incremental edits.

Read the Documentation.

Installation

pnpm add @pierre/highlights

Runs in Node.js, browsers, and Cloudflare Workers. The package initializes WebAssembly automatically; highlighting calls are synchronous after import.

Quick start

import { codeToHtml } from '@pierre/highlights';
import { pierreDark } from '@pierre/highlights/themes';

const htmlBytes = codeToHtml("console.log('Hello world!')", {
  lang: 'js',
  theme: pierreDark,
});
const html = new TextDecoder().decode(htmlBytes);

codeToHtml() returns UTF-8 HTML bytes. Decode them immediately, or copy them with .slice() before the next highlighting or tokenization call.

See the docs for token rendering, streaming, incremental editing, themes, and the API reference.

Development

moonx highlights:build
moonx highlights:dev
moonx highlights:test
moonx highlights:bench
moonx highlights:bench-live
moonx highlights:bench-memory

Benchmarks · Architecture · Bundled themes

License

Apache-2.0

FAQs

Package last updated on 29 Sep 2026

Related posts