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

@present-day/buzz

v0.1.1

Published

Cross-platform haptic and audio feedback library for web applications

Readme

@present-day/buzz

Cross-platform haptic and audio feedback library for web applications.

Features

  • 🎵 WebAudio-based click sounds with configurable intensity and gain
  • 📳 Haptic feedback for mobile devices (iOS and Android)
  • 🔧 Cross-platform compatibility (iOS, Android, web browsers)
  • 🎛️ Multiple feedback presets (light, heavy, success, error, etc.)
  • 💾 User preference management with pluggable storage
  • 🚀 Framework-agnostic (works with React, Vue, vanilla JS)
  • 📱 iOS special handling for optimal haptic feedback

Installation

npm install @present-day/buzz

Quick Start

import { triggerInteractionFeedback, INTERACTION_FEEDBACK_PRESET } from '@present-day/buzz'

// Trigger light feedback (default)
triggerInteractionFeedback()

// Trigger specific preset
triggerInteractionFeedback({ preset: INTERACTION_FEEDBACK_PRESET.SUCCESS })

// Override individual settings
triggerInteractionFeedback({
  hapticEnabled: true,
  soundEnabled: false,
  preset: INTERACTION_FEEDBACK_PRESET.ERROR
})

API Reference

Core Functions

triggerInteractionFeedback(options?)

Triggers haptic and/or audio feedback based on the provided options.

type TriggerInteractionFeedbackOptions = {
  preset?: InteractionFeedbackPreset
  hapticPreset?: HapticFeedbackPreset  
  soundPreset?: SoundFeedbackPreset
  hapticEnabled?: boolean
  soundEnabled?: boolean
  storageAdapter?: StorageAdapter
}

cancelInteractionFeedback()

Cancels any ongoing haptic feedback (if supported by the platform).

isHapticFeedbackAvailable()

Returns whether haptic feedback is available on the current device.

Presets

Available presets for both haptic and sound feedback:

  • LIGHT - Subtle feedback
  • MEDIUM - Moderate feedback
  • HEAVY - Strong feedback
  • SUCCESS - Positive action feedback
  • ERROR - Error/failure feedback
  • WARNING - Warning/caution feedback
  • SELECTION - Item selection feedback
  • BUZZ - Attention-grabbing feedback
  • NUDGE - Gentle notification
  • SOFT - Very light feedback
  • RIGID - Sharp, precise feedback

Preferences Management

import { 
  getHapticFeedbackEnabled,
  setHapticFeedbackEnabled,
  getSoundFeedbackEnabled,
  setSoundFeedbackEnabled 
} from '@present-day/buzz'

// Get current preferences
const hapticEnabled = getHapticFeedbackEnabled()
const soundEnabled = getSoundFeedbackEnabled()

// Update preferences
setHapticFeedbackEnabled(false)
setSoundFeedbackEnabled(true)

Custom Storage

By default, preferences are stored in localStorage. You can provide a custom storage adapter:

import { LocalStorageAdapter, type StorageAdapter } from '@present-day/buzz'

class CustomStorageAdapter implements StorageAdapter {
  getItem(key: string): string | null {
    // Your custom storage logic
    return null
  }
  
  setItem(key: string, value: string): void {
    // Your custom storage logic
  }
}

const customStorage = new CustomStorageAdapter()

// Use with feedback
triggerInteractionFeedback({ 
  storageAdapter: customStorage 
})

// Use with preferences
getHapticFeedbackEnabled(true, customStorage)
setHapticFeedbackEnabled(true, customStorage)

Platform Support

  • iOS Safari: Uses hidden checkbox technique for haptic feedback
  • Android Chrome: Uses Vibration API
  • Desktop browsers: Audio feedback only (no haptic support)
  • WebAudio: Supported in all modern browsers

License

MIT