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

@peal-sounds/peal

v0.2.1

Published

Professional UI sounds for web apps - CLI to manage sounds, thin Howler.js wrapper to play them

Readme

@peal-sounds/peal

Professional UI sound effects for your web applications.

  • CLI: Add and manage sounds from our curated collection
  • Library: Easy audio playback with volume control for web apps

Quick Start

Step 1: Add sounds from our collection:

npx @peal-sounds/peal add success error notification

Step 2: Use the generated helper that knows where your sounds are:

import { peal } from './peal';

// The generated peal.js handles all the paths for you
peal.success();   // Plays ./peal/success.wav
peal.error();     // Plays ./peal/error.wav

Installation

As a CLI tool

You can use Peal without installing it globally:

npx @peal-sounds/peal add [sounds...]

Or install globally for frequent use:

npm install -g @peal-sounds/peal

As a library

The Peal library is a thin wrapper around Howler.js that works with the sounds added via CLI:

npm install @peal-sounds/peal
# or
yarn add @peal-sounds/peal
# or
pnpm add @peal-sounds/peal

The CLI generates a peal.js file that handles all the paths for you:

// After running: npx @peal-sounds/peal add click success
import { peal } from './peal';

// Just use it - paths are handled automatically
peal.click();
peal.success();

Available Sounds

  • UI Feedback: success, error, notification, click, tap
  • Transitions: transition, swoosh
  • Loading: loading, complete
  • Alerts: alert, warning
  • Messages: message, mention
  • Interactive: hover, select, toggle
  • System: startup, shutdown, unlock

CLI Commands

List all sounds

npx @peal-sounds/peal list

Play sounds

# Play a specific sound
npx @peal-sounds/peal play click
npx @peal-sounds/peal play success

# Play a demo of all sounds
npx @peal-sounds/peal demo

# Demo with custom delay (ms) between sounds
npx @peal-sounds/peal demo --delay 2000

Add sounds to your project

# Interactive selection
npx @peal-sounds/peal add

# Add specific sounds
npx @peal-sounds/peal add click success error

# Add to custom directory
npx @peal-sounds/peal add --dir ./sounds

# Generate TypeScript helper
npx @peal-sounds/peal add --typescript

Remove sounds from your project

# Interactive removal
npx @peal-sounds/peal remove

# Remove specific sounds
npx @peal-sounds/peal remove click tap

# Remove from custom directory
npx @peal-sounds/peal remove --dir ./sounds

Usage Examples

React

import { peal } from './peal';

function SubmitButton({ onClick }) {
  const handleClick = async () => {
    peal.click();
    try {
      await onClick();
      peal.success();
    } catch (error) {
      peal.error();
    }
  };

  return (
    <button onClick={handleClick} onMouseEnter={() => peal.hover()}>
      Submit
    </button>
  );
}

Vue

<template>
  <button @click="handleSubmit" @mouseenter="playHover">
    Submit
  </button>
</template>

<script>
import { peal } from './peal';

export default {
  methods: {
    playHover() {
      peal.hover();
    },
    async handleSubmit() {
      peal.click();
      // Your submit logic
    }
  }
}
</script>

Vanilla JavaScript

import { peal } from './peal';

document.querySelector('#submit').addEventListener('click', () => {
  peal.click();
  // Your logic here
});

Library API Reference

The Peal library is designed to work seamlessly with sounds added via the CLI. The generated peal.js or peal.ts file automatically knows where your sounds are located.

Core Methods

  • peal.play(soundName, options?) - Play a sound
  • peal.stop(soundName?) - Stop a specific sound or all sounds
  • peal.pause(soundName?) - Pause a specific sound or all sounds
  • peal.volume(level?) - Get/set global volume (0-1)
  • peal.mute(muted?) - Get/set mute state

Convenience Methods

The generated helper file includes convenience methods for each sound you've added:

// If you added: peal add click success error
peal.click()      // Same as peal.play('click')
peal.success()    // Same as peal.play('success')
peal.error()      // Same as peal.play('error')

Play Options

peal.play('success', {
  volume: 0.5,    // Volume (0-1)
  loop: false,    // Loop the sound
  rate: 1.0      // Playback rate
});

Advanced Usage with Base Library

If you need more control, you can use the base Peal class directly:

import { Peal } from '@peal-sounds/peal'

const peal = new Peal()
peal.load('custom', '/path/to/sound.mp3')
peal.play('custom')

TypeScript Support

Peal includes TypeScript definitions out of the box:

import { peal, PealOptions } from './peal';

const options: PealOptions = {
  volume: 0.8,
  loop: false
};

peal.play('success', options);

License

MIT

Links


Made with ❤️ by the Peal team