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

faaah-error-sound

v1.0.0

Published

Zero-config npm package that plays a FAAAH alert sound on any JavaScript error, uncaught exception, or unhandled promise rejection — works in browser and Node.js with no dependencies.

Downloads

112

Readme

faaah-error-sound

Zero-config sound alert on every JavaScript error — browser & Node.js.

npm version npm downloads license Node.js >= 14

faaah-error-sound plays an audible FAAAH alert the instant your JavaScript app throws an uncaught error or unhandled promise rejection — in the browser and in Node.js — with absolutely zero configuration and zero runtime dependencies.

Stop staring at a silent screen. Hear your bugs the moment they happen.


Install

npm install faaah-error-sound

Usage

Add a single import to your entry file — that's it. No setup, no config, no callbacks.

// ESM
import "faaah-error-sound";

// CommonJS
require("faaah-error-sound");

Next.js / React

Add it to your root layout or _app.tsx:

import "faaah-error-sound";

export default function App({ Component, pageProps }) {
  return <Component {...pageProps} />;
}

Vite / Webpack

// main.js or index.ts
import "faaah-error-sound";

What it catches automatically

| Environment | Event | |---|---| | Browser | window.onerror (uncaught exceptions) | | Browser | window.unhandledrejection (unhandled promises) | | Browser | console.error(...) | | Node.js | process.uncaughtException | | Node.js | process.unhandledRejection | | Node.js | console.error(...) |


Platform support (Node.js)

| OS | Player used | |---|---| | macOS | afplay (built-in, no install needed) | | Windows | PowerShell System.Windows.Media.MediaPlayer | | Linux | mpg123mpg321mpvffplay (tries in order) |


Custom sound

Replace assets/faaah.mp3 with any MP3 file, then rebuild:

cp /path/to/your/sound.mp3 node_modules/faaah-error-sound/assets/faaah.mp3

Or for development (forked/cloned repo):

cp /path/to/your/faaah.mp3 assets/faaah.mp3
npm run build

Configuration

All settings are zero-config by default. To change them, edit src/cooldown.js inside the package:

| Setting | Default | Description | |---|---|---| | cooldownMs | 3000 ms | Minimum time between sound plays | | volume | 0.5 | Audio volume (0.0 – 1.0) |


How it works

import "faaah-error-sound"
        │
        ├─ Browser? ──► Attaches window.error + unhandledrejection listeners
        │                Overrides console.error
        │                Plays MP3 via Web Audio API (bundled base64, no HTTP request)
        │
        └─ Node.js? ──► Attaches process.uncaughtException + unhandledRejection
                         Overrides console.error
                         Plays MP3 via OS-native player (afplay / PowerShell / mpg123)
  • No dependencies — uses only Node.js built-ins and native OS audio tools
  • Cooldown system — prevents sound spam when multiple errors fire at once (3 s default)
  • Safe — all sound errors are swallowed; the package never crashes your app
  • Side-effect only — exports nothing, just import or require it

Requirements

  • Node.js ≥ 14.0.0
  • Browser: any modern browser with Web Audio API support

Author

Shivam Yadavgithub.com/shivamyadav


License

MIT © Shivam Yadav