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-notification

v0.34.1

Published

Official OpenTray native notification extension: OS-standard host-side notifications through UNUserNotificationCenter or the registered tray icon's balloon/toast channel.

Readme

@opentray/ext-notification

Official OpenTray notification extension: OS-standard title/body notifications for host-side callers (tray menu actions, background CLIs, moments without a visible page). There is no page bridge; v1 has no activation events, action buttons, inline replies, grouping, or custom sounds.

Role

  • attachNotification(tray) returns a session-scoped capability: notify(options), getAuthorizationStatus(), requestAuthorization(), and an async getBackend() capabilities snapshot.
  • notify is resolve-on-acceptance (the sound law): the promise resolves when the system accepts the notification for delivery; whether and when the user sees it is presentation policy, not acceptance.
  • Payload bounds are frozen platform-independent common contract measured in UTF-16 code units (String.length), enforced in the facade before any dispatch, and never silently truncated: title non-empty ≤ 64, body ≤ 256, subtitle ≤ 64; violations reject typed notification_payload_invalid (details: { field, lengthUtf16, limit }). Unknown NotifyOptions fields reject the same way (details: { field }) — v1 has no platform namespace and no passthrough. Unknown attach option fields throw instead of being silently ignored.
  • darwin authorization is real: UNUserNotificationCenter-backed status reads and requests settle as deferred transactions with a 10 s timeout (notification_failed, details: { reason: "authorization-timeout" }); a denied state makes notify reject typed notification_denied (details: { status }) with zero delivery calls, and acceptance linearizes against the cached last authorization snapshot for the session (never trusted across sessions).
  • win32 is a documented always-granted degradation: authorization commands answer granted/true immediately. notify rides the consumer's own registered tray icon balloon/toast channel (Shell_NotifyIcon(NIM_MODIFY, NIF_INFO) on the existing (HWND, uID) registration) — no new window or identity atom; a scope without a live registered icon rejects typed notification_tray_absent. One balloon slot per icon: a later notification replaces the earlier one. silent: true projects NIIF_NOSOUND.
  • win32 subtitle degradation: the facade joins the subtitle into the body as subtitle + "—" + body (em dash; a subtitle without a body stays alone), and the joined string is jointly validated against the 256-unit limit — an overflow rejects typed, never truncates.
  • All methods on Linux reject typed notification_platform_unsupported before any dispatch.
  • Rejections surface as NotificationError with a stable code from the frozen five-code family; backend error details pass through as-is. The shared transport-close code surfaces unchanged (the notification family defines no transport alias).

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

Install

pnpm add opentray @opentray/ext-notification

Typed Errors

| Code | Meaning | Details | | ---- | ------- | ------- | | notification_platform_unsupported | No native notification runtime for this platform (Linux). | { kind: "platform", platform } | | notification_denied | darwin: authorization is denied; zero delivery calls were made. | { status } | | notification_payload_invalid | Options shape/bounds failure (unknown field, bad type, empty title, over-limit, joined-body overflow on win32). | { field, lengthUtf16?, limit? } | | notification_tray_absent | win32 bridge: the command scope has no live registered tray icon channel. | bridge scope payload | | notification_failed | Native failure or the 10 s darwin authorization timeout. | { reason } (e.g. "authorization-timeout") or an OS error code |

Platform Matrix

| Capability | macOS | Windows | | ---------- | ----- | ------- | | Channel | UNUserNotificationCenter | Registered tray icon Shell_NotifyIcon(NIM_MODIFY, NIF_INFO) balloon/toast channel | | authorizationModel | user (granted/denied/notDetermined; deferred, 10 s timeout) | always-granted (immediate granted/true, documented degradation) | | title / body / subtitle limits | 64 / 256 / 64 UTF-16 units (platform-independent constants) | 64 / 256 / 64 UTF-16 units | | subtitle | Native field (supportsSubtitle: true) | Joined into body as subtitle—body (supportsSubtitle: false); joined form ≤ 256 jointly validated | | silent | Default = platform alert sound; true omits it | NIIF_NOSOUND when true | | Concurrency | System notification-center policy | One balloon slot per icon: later replaces earlier (latest-state, not a queue) | | Rendering | Notification Center (retention is system policy) | Toast on Win10+, classic balloon before; no action buttons, system-controlled duration | | 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.