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

failfanfare

v0.3.1

Published

Plays humorous sound effects when runtime errors occur. Also wraps your dev server CLI with crash sound detection.

Readme

failfanfare SDK

Transform your development experience with real-time auditory feedback.

npm version license

FailFanfare is a fun dual-mode SDK that plays sound effects in response to terminal and browser events. It's designed to keep you focused, entertained, and instantly aware of build failures or runtime crashes with a bit of humor.


CLI Mode (Terminal)

The CLI acts as a wrapper around your dev server. It pipes the output and watches for specific signals to play sounds.

Usage

npx failfanfare <your-command>

Examples

  • npx failfanfare npm run dev
  • npx failfanfare vite
  • npx failfanfare next dev

What it detects:

  • Success: "ready", "compiled successfully", "local:".
  • Errors: Syntax errors, unhandled exceptions, and invalid dependencies.
  • Crashes: When the sub-process exits with a non-zero code.

Browser Mode (Integration)

Seamlessly integrate FailFanfare into any web application. It automatically shuts down in production.

Installation

npm install failfanfare

Framework Integration

React

import { useFailFanfare } from "failfanfare/react";

function App() {
  useFailFanfare({
    watchConsole: true, // Listen to console.error
    enableSuccessSound: true, // Play sound on initial load
  });

  return <Layout>...</Layout>;
}

Vue 3

<script setup lang="ts">
import { useFailFanfare } from "failfanfare/vue";
useFailFanfare({ watchConsole: true });
</script>

Angular

import { FailFanfareService } from "failfanfare/angular";

@Component({...})
export class AppComponent implements OnInit {
  constructor(private fanfare: FailFanfareService) {}
  ngOnInit() {
    this.fanfare.init({ volume: 0.5 });
  }
}

Vanilla JS

import { initFailFanfare } from "failfanfare";
initFailFanfare();

Advanced Customization

Option 1: CLI Flags (ad-hoc)

npx failfanfare --success ./win.mp3 --error ./fail.mp3 npm run dev

Option 2: Unified Configuration (Recommended)

Add a failfanfare field to your package.json at the project root. This configuration works for both the CLI and the Browser.

{
  "failfanfare": {
    "sounds": {
      "success": "./public/custom-win.mp3",
      "error": "./public/custom-error.mp3",
      "critical": "./public/custom-crash.mp3"
    }
  }
}

Pro Tip: In your code, you can import your package.json to keep sounds perfectly in sync:

import pkg from "../package.json";
useFailFanfare({ sounds: pkg.failfanfare });

Configuration Reference

| Property | Type | Default | Description | | :------------------- | :-------- | :------ | :-------------------------------- | | enabled | boolean | true | Force disable the SDK. | | volume | number | 0.7 | Sound volume (0.0 to 1.0). | | throttleMs | number | 2000 | Prevention of sound overlapping. | | watchConsole | boolean | false | Trigger sound on console.error. | | enableSuccessSound | boolean | false | Play a startup sound. | | sounds | object | {} | Mappings for custom MP3 paths. |

Sound Event Mapping

| Event Key | Browser Trigger | CLI Trigger | | :--------- | :----------------------- | :--------------------- | | success | Initial page load | Build success keywords | | error | console.error fallback | Error keywords in logs | | runtime | Global JS exceptions | Fallback for error | | promise | Unhandled rejections | Fallback for error | | critical | Rapid error spam (5+) | Process crash/exit |


Build and Architecture

FailFanfare uses a sophisticated split build system powered by tsup:

  • CLI: Native Node.js build with OS-level audio routing.
  • Browser: Treeshakeable ESM/CJS build with CDN-backed assets.
  • Adapters: Lightweight framework wrappers.

MIT © Lancerhawk