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

@sjon-lang/highlight

v1.4.1

Published

SJON syntax-highlighting grammars: a CodeMirror StreamLanguage and a Shiki-compatible TextMate grammar for .sjon sources.

Readme

@sjon-lang/highlight

Reusable .sjon syntax-highlighting grammars: a CodeMirror 6 StreamLanguage and a TextMate grammar for Shiki (and any other TextMate consumer). Two engines, one source of truth — both derive from the same token rules, so every consumer highlights .sjon identically.

This package covers lexical highlighting only (comments, strings, numbers, :keys, form heads, brackets). The schema-aware layer a grammar can't see — resolved heads, keys, cross-ref names — comes from the language server's semantic tokens; see docs/TOOLING.md.

Install

Consumed as a workspace or path dependency. It is source-only: there is no build step — bundlers (Astro/Vite/esbuild) transpile the .ts and resolve the .json directly.

  • @codemirror/language is a peer dependency (the CodeMirror path).
  • shiki is needed only for the Shiki path.

CodeMirror 6

import { sjonLanguage } from '@sjon-lang/highlight';
import { EditorState } from '@codemirror/state';

EditorState.create({ extensions: [sjonLanguage, /* … */] });

Lower-level exports for embedding in an existing StreamParser: sjonToken, sjonStreamParser, and the SjonStreamState type.

Shiki / TextMate

import { sjonTextMateGrammar } from '@sjon-lang/highlight';
import { createHighlighter } from 'shiki';

const hl = await createHighlighter({
  langs: [sjonTextMateGrammar],
  themes: ['github-dark'],
});
hl.codeToHtml('(scene :w 800)', { lang: 'sjon', theme: 'github-dark' });

The raw TextMate grammar

sjonTextMateGrammar is the typed re-export of src/sjon.tmLanguage.json (scope source.sjon). Consume that file directly in any TextMate host — VS Code's contributes.grammars, a Sublime .sublime-syntax conversion, etc. The named scopes are stable theme targets:

| Construct | Scope | |---|---| | ; line comment | comment.line.semicolon.sjon | | block comment | comment.block.sjon | | "string" / """raw""" | string.quoted.double.sjon / string.quoted.triple.sjon | | escape | constant.character.escape.sjon | | number | constant.numeric.sjon | | :keyword | entity.name.tag.sjon | | form head | entity.name.function.sjon | | true / false / atoms | constant.language.sjon | | ( ) [ ] | punctuation.section.parens.* / punctuation.section.brackets.sjon |

Renaming a scope silently breaks downstream themes — they're pinned by the scope-surface test below, so a rename is a conscious edit.

Tests

pnpm test (or node --test --experimental-strip-types 'test/*.test.ts') runs both engines against a shared corpus: the sjonToken regression net, the TextMate scope surface, and a per-character CodeMirror↔TextMate parity check that catches drift between the playground (CM) and static-docs (Shiki) renderers. Fidelity is hand-verified against src/Lexer.zig and docs/LANGUAGE.md §2.