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

ump-plugin-notification

v0.0.1

Published

UMP Notification Plugin — Web Notifications API (notifications.spec.whatwg.org)

Readme

ump-plugin-notification

Web Notifications API (https://notifications.spec.whatwg.org) for UMP apps.

Install

npm install ump-plugin-notification

Peer dependencies (must already be installed in your app):

  • ump-core
  • ump-native

Usage

Importing the module installs Notification on globalThis (only when missing — a host implementation always wins) and also exposes it as a named export. Off-the-shelf libs (web-push, OneSignal, FCM shims) that reach for the bare global keep working.

import { Notification } from 'ump-plugin-notification';

// 1) Ask for permission.
const perm = await Notification.requestPermission();
if (perm !== 'granted') return;

// 2) Post a notification.
const n = new Notification('Hello', {
  body: 'World',
  icon: 'https://example.com/icon.png',
  tag: 't1',
  data: { foo: 'bar' },
});

// 3) Listen for lifecycle events.
n.addEventListener('show',  () => console.log('shown'));
n.addEventListener('click', () => console.log('clicked'));
n.addEventListener('close', () => console.log('closed'));
n.addEventListener('error', () => console.log('error'));

// Or via on* property setters.
n.onclick = () => console.log('clicked (prop)');

// 4) Programmatic close.
n.close();

API

Notification.permission

Read-only 'default' | 'granted' | 'denied'. Starts at 'default' until requestPermission() resolves.

Notification.requestPermission(callback?)

Returns Promise<NotificationPermission>. Legacy callback form is supported. If no host bridge is installed, resolves to 'denied' and leaves permission at 'default' so a later install can ask again.

Notification.maxActions

Static 2 (matches spec minimum). Action buttons themselves are forwarded to the host as options.actions with no JS-side validation.

new Notification(title, options?)

Recognised options: body, icon, image, badge, tag, data, silent, requireInteraction, lang, dir, vibrate, actions, timestamp, renotify. Unknown keys pass through verbatim.

Instance fields mirror the spec: title, body, icon, image, badge, tag, data, silent, requireInteraction, lang, dir, vibrate, timestamp. onshow / onclick / onclose / onerror property setters fire alongside addEventListener listeners.

notification.close()

Fire-and-forget dismiss. Idempotent — calling more than once is a no-op. Suppresses any subsequent late events from the host.

Spec deviations

  • getNotifications() is not provided (ServiceWorker scope).
  • serviceWorker accessor on instances is not modelled.
  • Action buttons are forwarded verbatim — no JS-side validation; the platform decides whether to render them.

Migration from ump-native

In ump-native 0.1.x, Notification was bundled with the main package. Starting 0.2.x, it ships as this separate plugin.

- import { Notification } from 'ump-native';
+ import { Notification } from 'ump-plugin-notification';

No API changes. Type aliases NotificationOptions and NotificationPermission are also re-exported.