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

aiaudiojs

v0.5.9

Published

Thin Web Audio shell over Howler.js — dispose() idempotency, AbortSignal cancellation, first-class equal-power crossfade(), and ai*js conventions. Howler stays as a peerDependency.

Readme

aiaudiojs

Thin Web Audio shell over Howler.js with ai*js lifecycle conventions: idempotent dispose(), AbortSignal support, explicit unlock(), and first-class crossfade().

Status: 0.5.9 - stable 1.0-track surface. Howler remains a peer dependency; the package ships the root entry only.

Install

pnpm add aiaudiojs howler
import { createAudio } from "aiaudiojs";

Quick Start

const audio = createAudio({ volume: 0.8 });

button.addEventListener("click", async () => {
  await audio.unlock();
  const laser = await audio.load("/sfx/laser.ogg");
  const id = laser.play({ volume: 0.5 });
  laser.fade(0.5, 0, 250, id);
});

window.addEventListener("beforeunload", () => audio.disposeAll());

autoUnlock defaults to true and attaches touchstart, mousedown, and keydown listeners. Browsers still require the resume attempt to happen inside a real user gesture; call audio.unlock() from your first trusted UI event when in doubt.

Core API

  • createAudio(options?) returns an Audio controller. Options: autoUnlock, volume, resumeOnVisibility.
  • audio.unlock() resumes Howler's shared AudioContext.
  • audio.load(url, signal?) resolves to a reusable Sound; AbortSignal rejects with AbortError.
  • sound.play(options?) returns Howler's numeric sound id. PlayOptions.volume is per-sound gain and defaults to 1; the Audio instance master volume is applied globally by Howler.
  • sound.pause(id?), sound.stop(id?), sound.resume(id?), sound.fade(from, to, ms, id?), sound.dispose().
  • audio.crossfade(from, to, { duration, curve, signal }) supports linear and equal-power.
  • audio.disposeAll() unloads every managed sound and removes unlock/visibility listeners.

Sharp Edges

  • Howler volume is global. Multiple Audio instances can overwrite each other's master volume; prefer one controller per app or scene.
  • load() aborts unload the Howl and reject, but Howler may still emit a late internal load event after decode work has already started. If you abort uncertain loads, call disposeAll() during scene teardown.
  • equal-power crossfade requires Web Audio mode and Howler internals with a gain node. HTML5 fallback throws AudioError; callers may retry with linear.
  • The linear crossfade path delegates to Howl.fade(). Aborting clears this wrapper's timer, but Howler's internal ramp cannot be cancelled.
  • URLs are passed directly to Howler. Validate untrusted URLs before calling load().

AI Context

License

MIT