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

@sandom/glint

v0.1.0

Published

The Glint implementation: the Glint server, client, clip recorder and clip player on Sandom, with the Glint core.

Readme

@sandom/glint

The Glint implementation on Sandom's renderer: the Glint server, client, clip recorder and clip player, and the Glint core. Glint sends the paint of a document as frames, and a clip keeps them in a file. The specification of Glint and of its clips is at glint.sandom.dev.

License

This package is under the GNU Affero General Public License, version 3 or any later version (LICENSE, NOTICE). DevBlanket AB also offers it under commercial license terms. The contribution terms are in CONTRIBUTING.md.

Install

Install the package beside the npm package sandom. The peer dependency of this package names one exact version of sandom: the Glint core holds the renderer core of that version, and the modules of sandom call its exports.

npm install @sandom/glint sandom@<the version of the peer dependency>

The renderer core

The Glint core is Sandom's renderer core with the Glint parts. Sandom must load the Glint core in place of its own core.

  • Deno, Node and Bun: import @sandom/glint/install-core before any module of sandom. Sandom compiles its core once in a process; when a module of sandom loads first, the import fails and tells you so.
  • A page: the import map maps sandom/renderer-core.wasm to the file of @sandom/glint/glint-core.wasm. A page that only plays clips with the WebGPU backend can map @sandom/glint/player-core.wasm, the Glint core reduced to the exports that the clip player calls.

Record and play a still

import "@sandom/glint/install-core";
import { createSandomDOM } from "sandom/dom";
import { sharedDomCore } from "sandom/dom-wasm/core";
import { createRemoteRasterClipRecorder } from "@sandom/glint/raster-clip";
import { openGlintClip } from "@sandom/glint/raster-clip-player";

const dom = createSandomDOM({ viewportW: 320, viewportH: 200 });
const root = dom.createElement("main");
root.style.background = "rgb(32, 96, 160)";
const recorder = createRemoteRasterClipRecorder({ core: sharedDomCore });
const surface = dom.createRenderSurface(root, {
  viewportWidth: 320,
  viewportHeight: 200,
  now: () => 0,
  requestFrame: () => 1,
  cancelFrame: () => {},
  graphicsBackend: "plan",
  onRasterPlan: recorder.onRasterPlan,
});
const still = await recorder.still(surface);
await surface.shutdown();

const player = await openGlintClip(still, {
  readback: "float32",
  onFrame: (result) => console.log(result.width, result.height),
  requestFrame: () => 0,
  cancelFrame: () => {},
});
await player.settled();
await player.close();

Entries

| Entry | Content | | --- | --- | | @sandom/glint/install-core | Makes the Glint core the renderer core of a Deno, Node or Bun process. | | @sandom/glint/raster-clip | createRemoteRasterClipRecorder, openRemoteRasterClip, clipSegments and clipParts. | | @sandom/glint/raster-clip-player | openGlintClip, the clip player. | | @sandom/glint/raster-stream-server | The Glint server of a render surface. | | @sandom/glint/raster-stream-client | The Glint client, which draws the frames of a server. | | @sandom/glint/raster-stream-error | RemoteRasterError, the error of the Glint core. | | @sandom/glint/raster-records | The input and document state records. | | @sandom/glint/raster-webtransport | A Glint connection over WebTransport. | | @sandom/glint/glint-page | A document presented to Glint clients. | | @sandom/glint/glint-core.wasm | The Glint core. | | @sandom/glint/player-core.wasm | The Glint core reduced to the exports of the clip player. | | @sandom/glint/reduce-core | reduceGlintCore: the Glint core reduced to the modules of a page. |

Clip parts

clipParts(core, clip) divides a clip of codec none into [{ prefix, payload }]. Each payload is the bytes of one font file or one image. The prefixes and payloads in order are the clip, and one resource gives equal payload bytes in every clip. A store can thus keep each payload once, with its SHA-256 as its key. A clip of another codec has no parts: clipParts throws.

Reduce the core for a page

reduceGlintCore({ binaryen, coreBytes, moduleSources }) keeps the exports that the modules of a page name. binaryen is your instance of the npm package binaryen (version 123 or later). coreBytes are the bytes of GLINT_CORE_URL. moduleSources are the texts of the modules of the page, of sandom and of this package. The page's import map then maps sandom/renderer-core.wasm to the reduced core.

import binaryen from "binaryen";
import { readFile } from "node:fs/promises";
import { GLINT_CORE_URL, reduceGlintCore } from "@sandom/glint/reduce-core";

const { bytes } = reduceGlintCore({ binaryen, coreBytes: await readFile(GLINT_CORE_URL), moduleSources });