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

@nippur72/crt-emulator

v1.2.0

Published

CRT screen emulation (old color TV set) class written in TypeScript and WebGL

Readme

@nippur72/crt-emulator

A WebGL-based CRT (Cathode-Ray Tube) screen emulator library used for @nippur72 web-based emulators.

The fragment shader emulates screen curvature, scanlines, an RGB phosphor shadow mask, and a composite-video chroma path: band-limited colour bleed plus luma-to-chroma crosstalk (the rainbow/colour fringing typical of 8-bit computers such as the C64 connected via composite video).

Usage

import { CRTEmulator } from "@nippur72/crt-emulator";

const crt = new CRTEmulator(canvas);
crt.init();

// every frame
crt.render(320, 200, false, imageData, {
  chromaBleed: 2.0,       // chroma smear radius in source pixels (0 = none)
  chromaPhase: 0.5,       // subcarrier cycles per source pixel (0.5 = NTSC, 0.625 = PAL)
  chromaCrosstalk: 0.5,   // luma -> chroma leakage, i.e. fringing strength (0..1)
});

All options are optional and merged with sensible defaults, see CRTEmulatorOptions in src/crt_emulation.ts.

Composite chroma options

  • chromaBleed (default 2.0) — radius in source pixels over which colour detail is smeared along the scanline. A TV's chroma path has far less bandwidth than its luma path, so saturated colours bleed ~1.5–3 pixels at 320-wide output while luminance stays sharp. 0 disables the bleed (fringing alone can still be enabled via chromaCrosstalk).
  • chromaPhase (default 0.5) — colour-subcarrier phase advance in cycles per source pixel. This is the ratio of subcarrier to pixel clock and controls the hue of the crosstalk fringes: 0.5 for NTSC (C64 US: 3.58 MHz / 7.16 MHz), 0.625 for PAL (C64 EU: 4.43 MHz / 7.09 MHz), 0 for a plain symmetric smear.
  • chromaCrosstalk (default 0.5) — luma-to-chroma leakage (0..1). Sharp luminance edges contain energy at the subcarrier frequency; a real TV decodes this as spurious colour, producing the alternating rainbow fringes on text and high-contrast edges.

Demo

Run npm run demo from the repository root and open http://localhost:8080/demo/. It serves the repo (the demo imports the built library from dist/) and renders a C64-like 320×200 test frame with interactive sliders for all composite-chroma settings. Rebuild first with npm run build after changing the shader.

You can also paste a screen copied from an emulator (e.g. a VICE screenshot): focus the page and press Ctrl+V — the image is used as the emulator source, and the canvas resizes to keep its aspect ratio. "reset demo frame" restores the built-in test pattern.

License

MIT