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

websfx

v1.1.0

Published

Play synthesized UI sound effects using the Web Audio API

Readme

websfx

NPM

NPM version build codecov

🔊 Play synthesized UI sound effects in the browser.

No dependencies. No audio assets. Sounds are generated at runtime with the Web Audio API. Import what you need with tree-shakable ESM.

Demo

Try out the sound effects in the playground.

Quick Start

import { click, success, configure } from 'websfx';

configure({ volume: 0.5 });

click();
success();

Install

NPM:

npm install websfx

CDN:

<script src="https://unpkg.com/websfx@latest/dist/index.umd.min.js"></script>

Usage

ES Modules:

import { click, success } from 'websfx';

click();
success();

CommonJS:

const { click, success } = require('websfx');

click();
success();

UMD:

<script src="https://unpkg.com/websfx@latest/dist/index.umd.js"></script>
<script>
  const { click } = window.websfx;

  click();
  websfx.success();
</script>

Every sound accepts optional overrides:

import { click } from 'websfx';

click({ volume: 0.5 }); // quieter
click({ pitch: 2 }); // one octave higher

Configure

configure() applies partial updates:

import { beep, configure } from 'websfx';

configure({ volume: 0.8 }); // master volume from 0 to 1 (default 1)
configure({ volume: 0 }); // mute all sounds

beep({ volume: 0.2 }); // 0.2 * master volume

It returns the configuration:

const { volume } = configure();

console.log(volume); // 1

Sounds

| Group | Sounds | | --- | --- | | Input | click, hover, focus, press, release, longPress, doubleClick, drag, drop, type | | State | select, deselect, open, close | | Navigation | back, forward | | Feedback | beep, success, error, warning, cancel, notification | | Clipboard | copy, paste | | Misc | remove, reaction |

All sounds take optional SoundOptions:

interface SoundOptions {
  volume?: number; // 0 to 1 multiplier (default 1)
  pitch?: number; // frequency multiplier (default 1)
}

beep also accepts a tone frequency:

beep({ frequency: 440 });

Notes

  • The AudioContext is created lazily on the first sound and shared for the lifetime of the session.
  • When the browser autoplay policy blocks audio, the context is resumed automatically on the next user gesture that plays a sound.
  • Calling a sound in environments without Web Audio (SSR, Node.js) is a safe no-op.

Release

Release is automated with Release Please.

License

MIT