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

highlightjs-ass

v1.0.3

Published

(Advanced) SubStation Alpha subtitle grammar for highlight.js

Readme

Advanced SubStation Alpha plugin for highlight.js

0BSD-licensed highlight.js plugin of the ASS/SSA subtitle file syntax.

What is ASS/SSA?

The original SubStation Alpha (SSA) format dates back to at least 1996 and has been used for translating media across various written languages.

Advanced SubStation Alpha (ASS) is the latest iteration of SSA, versioned as 4.00+ as opposed to 4.00 and below for the original format. It does not have a true specification, but instead has two de-facto implementations: originally (xy-)vsfilter and later libass.

This project aims to cover both ASS and SSA whenever possible, but significant changes across major versions of SSA may hinder support for older versions. libass is treated as the actual specification for the purposes of this project, as they are cross-platform whereas vsfilter is limited to Windows, and libass maintainers try to keep compatibility with vsfilter whenever it makes sense.

Setup

Requires node.js version 22.12 or later to build.

This project uses pnpm as its package manager. If you already installed the latest LTS versions of node.js, you'll already have corepack installed. Use corepack pnpm install to install all dependencies.

Generating CDN builds and Testing

CDN-optimized builds can be generated with

pnpm build

Both markup and detection tests can be done via:

pnpm test

Without having to clone the highlight.js project.

However, we are also compatible with the official suite used by highlight.js! Clone this project inside highlight.js/extra and then from the root directory containing highlight.js run:

npm install
npm run build
npm run test

Note that highlight.js is officially de-emphasizing the auto-detect feature, so npm run test-detect will yield 0 results, but we did make auto-detection work with our own test suite.

Usage

In the browser

The bare minimum for using this highlighter on a web page is linking to the highlight.js library, one of its themes, this plugin, and then calling highlightAll:

Modern ES6 method

<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/dark.min.css"
/>
<script type="module">
  import hljs from "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/es/highlight.min.js";
  import hljsAss from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";
  hljs.registerLanguage("ass", hljsAss);
  hljs.highlightAll();
</script>

Traditional Method

Mainly used if you need IE11 support.

<link
  rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/dark.min.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script>
  hljs.highlightAll();
</script>

For the plaintext code to highlight

It is highly recommended to wrap code blocks with pre and code tags, like this:

<pre><code class="language-ass">
[Script Info]
...
</code></pre>

You also want class="language-ass" to be explicit about which language syntax should be used. We do support auto-detection, but short snippets may be errenously detected as other supported highlight.js languages.