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

@nomercy-entertainment/nomercy-subtitle-octopus

v0.1.0

Published

NoMercy-owned libass/SubtitleOctopus wrapper. Auth, cross-origin worker, canvas geometry, and lifecycle patches built in. No UI.

Readme

@nomercy-entertainment/nomercy-subtitle-octopus

NoMercy-owned TypeScript wrapper around the libass-wasm (SubtitleOctopus) WASM renderer.

This package is not a fork of upstream — it's a thin consumer-side wrapper that adds the patches NoMercy needs without modifying the WASM worker. The actual fork of libass/JavascriptSubtitlesOctopus lives at @nomercy-entertainment/libass-wasm — that package owns the C++ source, Emscripten build pipeline, and the binaries.

Patches owned here (main-thread, TypeScript)

  • Bearer token auth — pre-fetch subtitle + font files on the main thread with Authorization: Bearer <token>, hand the worker blob URLs. Worker stays unmodified, never makes auth-required calls. Custom request schemes (nmsync:, cast:, data:, blob:, file:, etc.) bypass the same-origin guard so the token never leaks onto requests that can't carry it.
  • Cross-origin worker instantiation — Blob URL + importScripts() shim so workers load from a different origin (CDN deployments).
  • Canvas geometry syncResizeObserver against a configurable geometrySource element; copies six CSS properties to canvasParent so the libass canvas tracks the player's overlay through fullscreen / theater / float transitions.
  • Lifecycle race guardscurrentLoadedUrl + race-token pattern, orphan canvas sweep, idempotent dispose.
  • URL resolutionbasePath prepend with proper RFC-3986 absolute-URL detection (any scheme, plus protocol-relative //host/path).

Binaries

public/subtitles-octopus-worker.{js,wasm} and public/default.ttf are vendored from upstream [email protected] pending a first NoMercy build out of the sister fork (@nomercy-entertainment/libass-wasm). License chain reproduced in COPYRIGHT.

Worker files — copy to public

The libass WASM worker files ship inside this package's dist/ directory. Your build tool must copy them into the public/static directory so the browser can load them:

// vite.config.ts
import { viteStaticCopy } from 'vite-plugin-static-copy';

export default {
  plugins: [
    viteStaticCopy({
      targets: [
        {
          src: 'node_modules/@nomercy-entertainment/nomercy-subtitle-octopus/dist/subtitles-octopus-worker*.{js,wasm,data}',
          dest: 'static',
        },
      ],
    }),
  ],
};

Then pass the copied paths when registering the plugin:

player.addPlugin(OctopusPlugin, {
  workerUrl: '/static/subtitles-octopus-worker.js',
  legacyWorkerUrl: '/static/subtitles-octopus-worker-legacy.js',
});

Usage

import { NMSubtitleOctopus } from '@nomercy-entertainment/nomercy-subtitle-octopus';

// Pre-fetch subtitle bytes and font binaries with whatever auth pipeline you use.
const trackContent = await fetchAuthedText('/episode-1.ass');
const availableFonts = await fetchAuthedFonts('/fonts/');

const octopus = new NMSubtitleOctopus({
	video: videoElement,
	trackContent,
	availableFonts,
	geometrySource: playerContainer,
});

octopus.on('rendererReady', ({ url }) => console.log('renderer ready', url));

The renderer never performs authenticated network I/O — your consumer (or the NoMercy player kit) pre-fetches every byte the worker needs and passes it as trackContent plus a name → blob:URL font map.

License

MIT — TypeScript wrapper code. The vendored WASM artefact carries the upstream license chain (LGPL-2.1 / FTL / GPL-2.0 / MIT / ISC / NTP / Zlib / BSL-1.0) reproduced in COPYRIGHT.