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

@zx-vibes/emulator

v0.2.0

Published

ZX Spectrum 48K emulator foundation for zx-vibes.

Readme

@zx-vibes/emulator

JavaScript ZX Spectrum 48K emulator package used by zx-vibes.

Current package version in this repository: 0.1.3.

The package provides a browser-oriented ZXSpectrum facade, lower-level CPU and Spectrum components, a distributable browser bundle, examples, and the 48K ROM asset used by toolkit preview/playback flows.

Install

pnpm add @zx-vibes/emulator

Node.js 20 or newer is required for package development and tests. Browser use depends on standard Canvas and Web Audio APIs.

Browser Quick Start

<canvas id="screen"></canvas>
<script type="module">
  import { ZXSpectrum } from 'https://cdn.jsdelivr.net/npm/@zx-vibes/emulator@latest/dist/zxgeneration.esm.js';

  new ZXSpectrum('#screen', {
    rom: 'https://cdn.jsdelivr.net/npm/@zx-vibes/emulator@latest/rom/48k.rom',
    scale: 2,
    sound: true,
  });
</script>

Package import:

import { ZXSpectrum } from '@zx-vibes/emulator';

const spectrum = new ZXSpectrum('#screen', {
  rom: './rom/48k.rom',
  scale: 2,
  sound: true,
  onReady: (machine) => machine.start(),
});

Features

  • ZX Spectrum 48K CPU, memory, ULA/display, keyboard, beeper, tape, and snapshot support.
  • Browser facade for canvas rendering, keyboard input, touch keyboard, and Web Audio playback.
  • TAP and TZX tape loading. loadTape(data, filename) requires a filename so the parser can select .tap or .tzx behavior.
  • .z80 v1 snapshot loading plus 48K-compatible .z80 v2/v3 loading using standard pages 8, 4, and 5.
  • Internal state snapshot save/load for emulator sessions.
  • Low-level component exports used by @zx-vibes/toolkit tests and runtime integration.

Current limitations:

  • 128K .z80 paging is not supported.
  • setTurboMode(enabled) records a compatibility flag; the public browser loop remains frame-paced.
  • saveSnapshot() returns the emulator's internal state object, not a .z80 file.

Loading Tape And Snapshots

const tape = await fetch('./game.tzx').then((response) => response.arrayBuffer());
spectrum.loadTape(tape, 'game.tzx');
spectrum.playTape();
const snapshot = await fetch('./game.z80').then((response) => response.arrayBuffer());
spectrum.loadZ80Snapshot(snapshot);

See API.md for the current facade and lower-level API reference.

Package Exports

  • .: browser facade and lower-level exports from src/index.js.
  • ./src/*: source modules.
  • ./dist/*: Rollup browser bundles.
  • ./rom/*: ROM assets.
  • ./package.json: package metadata.

Published files include src, dist, rom, examples, README.md, API.md, and LICENSE.

Development

From the repository root:

pnpm --filter @zx-vibes/emulator build
pnpm --filter @zx-vibes/emulator typecheck
pnpm --filter @zx-vibes/emulator lint
pnpm --filter @zx-vibes/emulator test
pnpm --filter @zx-vibes/emulator start

Root gallery browser bundles are checked against packages/emulator/dist/zxgeneration.esm.js by:

pnpm run check:gallery-bundles

ROM Notice

The package includes a ZX Spectrum 48K ROM for emulator use. The ROM is copyrighted material distributed under the permission described in rom/README.md; that notice is separate from the MIT license covering the source code.

License

MIT for the package source. See rom/README.md for the separate ROM notice.