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

@opentray/ext-sound

v0.34.1

Published

Official OpenTray native sound extension: system beeps, named system sounds, and low-cost file playback.

Readme

@opentray/ext-sound

Official OpenTray sound extension: OS-standard sound feedback atoms — system beeps, named system sounds, and low-cost file playback for host-side callers (tray menu actions, background CLIs, moments without a visible page). Sounds a page can play itself (HTMLAudioElement) stay the page's job; there is no page bridge.

Role

  • attachSound(tray) returns a session-scoped capability: beep(kind?) (default/info/warning/error/question), playSystemSound(name), playSound(path), and an async getBackend() capabilities snapshot.
  • Fire-and-forget semantics: every method resolves when playback is accepted (the native call was taken), not when it completes. There are no completion events.
  • playSystemSound resolution law (frozen order): a common name (notification/warning/error) resolves through the frozen projection table (darwin Glass/Sosumi/Basso, win32 SystemAsterisk/SystemExclamation/SystemHand); anything else passes through as a platform-native sound name. A native miss rejects typed sound_not_found with a details payload — never a silent no-op, never a fallback to a default sound. default/info/question belong to beep only.
  • playSound preflight before any transport use: ~ expansion, cwd-relative resolution, canonicalization, and readability (typed sound_file_unreadable). On win32 the file must additionally pass the frozen structural WAV validation (RIFF/WAVE magic, declared_size + 8 <= actual, fmt and data chunks inside the declared region, fmt payload >= 16 bytes, 12-byte minimum, 64 MiB cap, no decoding); violations reject typed sound_format_unsupported. darwin performs no content validation (its v1 format set wav/aiff/mp3/m4a is backend-declared).
  • All methods on Linux reject typed sound_platform_unsupported before any dispatch. v1 carries no playSound options (reserved empty PlaySoundOptions); unknown option fields throw instead of being silently ignored.
  • Rejections surface as SoundError with a stable code from the frozen four-code family; backend error details pass through as-is. The shared transport-close code surfaces unchanged (the sound family defines no transport alias).

The shared schema (types, the frozen common-name table, and the typed error family) lives in @opentray/spec and is re-exported here.

Install

pnpm add opentray @opentray/ext-sound

Typed Errors

| Code | Meaning | | ---- | ------- | | sound_platform_unsupported | No native sound runtime for this platform (Linux). | | sound_not_found | The requested system sound name does not resolve (details carry the attempted stages). | | sound_format_unsupported | win32 structural WAV validation failed. | | sound_file_unreadable | The file path does not canonicalize or cannot be read. |

Platform Matrix

| Capability | macOS | Windows | | ---------- | ----- | ------- | | beep('default') | NSBeep() | MessageBeep(MB_OK) | | beep('info'/'warning'/'error'/'question') | Documented degradation: plain NSBeep() (no leveled alert sound) | MessageBeep(MB_ICONASTERISK/EXCLAMATION/HAND/QUESTION) | | playSystemSound common names | Glass / Sosumi / Basso | SystemAsterisk / SystemExclamation / SystemHand | | playSystemSound native names | NSSound(named:) catalog | Registry sound-scheme names via SND_ALIAS (the registry catalog is the miss oracle; the native BOOL is not) | | playSound formats | v1 promise set: wav/aiff/mp3/m4a (backend-declared, no content validation) | WAV only, frozen structural validation before playback | | playSound concurrency | Multiple instances mix naturally | Single channel: a new playback cancels the previous (documented degradation) | | getBackend().fileFormats | ['wav','aiff','mp3','m4a'] | ['wav'] | | Linux | unsupported by design (typed rejection before dispatch) | — |

Packaging

The facade ships one embedded native package: platforms/<target>/ libraries for darwin-arm64/x64 and win32-arm64/x64 plus the platforms/manifest.json identity chain — no optionalDependencies platform packages. Consumers never install or locate the native library manually.

Consumer guides live in the public skills/opentray documentation.