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

osu-beatmap-preview

v0.1.3

Published

Canvas renderer for osu!standard beatmap previews.

Readme

osu-beatmap-preview [WIP]

An osu!standard beatmap renderer based on JerryZhu99/osu-preview that utilizes HTML canvas.

The package uses osu-parsers, osu-classes, and osu-standard-stable for most non-rendering work. The goal is to provide a ready-to-use library that lets developers render osu! beatmap previews in a lightweight way while keeping playback controls, UI, fetching, and application integration in userland.

Features

  • Beatmap combo colors.
  • Correctly computed complex slider shapes. The original osu-preview implementation freezes on Bezier sliders with multiple anchors due to incorrect computation. It is mathematically correct for a Bezier curve, but osu! uses approximation for Beziers. For more details, see PathApproximator.cs#L79.
  • Aspire maps are supported.
  • Catmull sliders are rendered correctly.
  • Multiple previews can be created at once without noticeable performance drawbacks.
  • Canvas-first API with no React, browser extension, or UI dependency.
  • osu!standard mod bitmasks can be passed when loading a beatmap.
  • Torus font assets are included for combo number rendering.

Missing, Planned Features

  • Slider repeats and tails are not fully implemented.
  • Full skinning API.
  • Mania rendering is not part of the public package yet.

Installation

npm install osu-beatmap-preview

Usage

Load the bundled Torus font CSS before rendering if you want combo numbers to match the default renderer:

import "osu-beatmap-preview/assets/fonts/torus.css";
import {StandardBeatmapPreview} from "osu-beatmap-preview";

const canvas = document.querySelector("canvas")!;
const preview = new StandardBeatmapPreview(canvas, {
  width: 640,
  height: 480,
});

const osuText = await fetch(`https://osu.ppy.sh/osu/${beatmapId}`).then((response) => response.text());

preview.loadBeatmapText(osuText, {
  mods: 0,
});

preview.render(42_000);

API

  • new StandardBeatmapPreview(canvas, options?)
  • loadBeatmapText(osuText, options?)
  • loadBeatmap(beatmap, options?)
  • render(timeMs)
  • resize(width, height, devicePixelRatio?)
  • clear()
  • dispose()
  • beatmap

The renderer accepts an existing HTMLCanvasElement. It does not query the DOM, fetch beatmaps, manage playback time, or provide UI controls.

Development

Prerequisites

  • Node.js 18 or newer.
  • npm.

Setup

git clone https://github.com/dotremilie/osu-beatmap-preview.git
cd osu-beatmap-preview
npm install

Build

npm run build

Typecheck

npm run typecheck

Acknowledgements