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

simple-notification-sounds

v1.0.0

Published

Simple, tree-shakable browser audio notifications (success, alert, warning, attention, error) with short, medium, and long sounds.

Readme

Simple Notification Sounds

A lightweight, flexible library for adding meaningful audio cues to web applications. This library provides distinct notification sounds that are designed to convey information even in environments where users may not be looking at the screen.

Demo

🎮 Try the interactive demo to hear all the different sounds!

Installation

npm install simple-notification-sounds

Usage

ES Module

import {
  playSuccess,
  playAttention,
  playAlert,
  playWarning,
  playError,
} from "simple-notification-sounds";

// Play a medium success sound (default)
playSuccess();

// Play a short attention sound
playAttention("short");

// Play a long warning sound
playWarning("long");

UMD (Browser)

Via CDN (Recommended)

After publishing to npm, you can use the package directly from CDN:

<!-- From unpkg -->
<script src="https://unpkg.com/simple-notification-sounds@latest/dist/simple-notification-sounds.umd.js"></script>

<!-- OR from jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/simple-notification-sounds@latest/dist/simple-notification-sounds.umd.js"></script>

<script>
  // Play a medium attention sound (default)
  SimpleNotificationSounds.playAttention();

  // Play a short error sound
  SimpleNotificationSounds.playError("short");
</script>

Local File

<script src="dist/simple-notification-sounds.umd.js"></script>
<script>
  // Play a medium attention sound (default)
  SimpleNotificationSounds.playAttention();

  // Play a short error sound
  SimpleNotificationSounds.playError("short");
</script>

Sound Types and Use Cases

Each sound is carefully designed with distinctive audio characteristics to convey specific meanings without requiring visual confirmation.

Success

Success sounds use bright, harmonically rich tones with upward musical patterns that are universally recognized as positive.

  • Short: Simple confirmation beep - useful for quick acknowledgment of successful actions
  • Medium: Two-note rising pattern - ideal for confirming task completion
  • Long: Complete major chord progression with harmonies - perfect for signaling the completion of complex processes

Real-world usage: Scan completions, form submissions, transaction approvals, batch processing completions

Attention

Attention sounds use clear, focused tones that are designed to gently draw the user's focus without urgency.

  • Short: Single tone for subtle notifications
  • Medium: Two-tone pattern for moderate attention
  • Long: Melodic sequence for sustained focus

Real-world usage: Reminders, non-critical updates, user prompts, background notifications

Alert

Alert sounds use attention-grabbing tones designed to demand immediate focus, with patterns that cut through background noise.

  • Short: Sharp high note for quick, urgent notification
  • Medium: Repeated pattern that creates immediate urgency
  • Long: SOS-like pattern that is universally recognized as requiring immediate attention

Real-world usage: Critical system notifications, time-sensitive alerts, security warnings, emergency alerts

Warning

Warning sounds use slightly dissonant tones that indicate caution without the full urgency of alerts.

  • Short: Quick caution indicator for minor issues
  • Medium: Classic two-tone descending pattern that signals potential problems
  • Long: Minor descending pattern with repetition that clearly communicates significant issues

Real-world usage: Input validation errors, low battery/resources warnings, approaching thresholds, preventative notifications

Error

Error sounds use harsh, buzzy tones with dissonant intervals that clearly indicate something is wrong.

  • Short: Single buzz tone for quick error indication
  • Medium: Dissonant descending interval that signals standard errors
  • Long: Complex pattern with alternating dissonant tones and low-frequency background for critical failures

Real-world usage: Processing failures, authentication errors, system malfunctions, critical exceptions

Design Philosophy

Audio Design for Non-Visual Environments

The sounds in this library are specifically designed for scenarios where users may not be looking at the screen, such as:

  • Inventory management and warehouse operations
  • Manufacturing floors with equipment monitoring
  • Healthcare environments where visual attention is focused elsewhere
  • Accessibility applications for users with visual impairments

Each sound is carefully crafted with distinct timbres, musical patterns, and frequencies to ensure they remain distinguishable even in noisy environments.

Bundle Size and Distribution Decision

This library uses a direct code approach rather than loading audio files or distributing through CDN for several key reasons:

  1. Minimal Dependencies: No need for external audio files means no additional network requests
  2. Offline Capability: All sounds work without internet connection once the library is loaded
  3. Customization: Programmatically generated sounds can be easily modified for specific needs
  4. Size Efficiency: The code-based approach results in a smaller total bundle size than equivalent audio files
  5. Cross-Browser Compatibility: Uses the Web Audio API which has excellent browser support

While distributing pre-recorded audio files via CDN might have simplified implementation, the current approach offers superior flexibility, performance, and user experience, especially for applications that need to function in environments with limited connectivity.

However, for convenience, this library is published to npm and automatically available through unpkg and jsDelivr CDNs, allowing you to include it in your projects without installing via npm.

Browser Compatibility

This library uses the Web Audio API and is compatible with all modern browsers:

  • Chrome 49+
  • Firefox 51+
  • Safari 9.1+
  • Edge 12+

License

MIT