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

@supersuit/home-screen-app

v0.1.0

Published

The small rules a web app saved to a phone's Home Screen gets wrong: when a floating Back button should show, and what its notifications line should say.

Readme

@supersuit/home-screen-app

The small rules a web app saved to a phone's Home Screen keeps getting wrong, as pure functions you can test: when a floating Back button should show, and what the notifications line should say. No dependencies, no framework; your component gathers the facts and renders the answer.

npm i @supersuit/home-screen-app

A floating Back button

A Back button at the top of a long screen scrolls away with it. Once the screen is past its own Back, scrolling up a little brings a floating copy in; scrolling down, or reaching the top, takes it away.

import { backReveal, backRevealAt } from '@supersuit/home-screen-app'

let state = backRevealAt(window.scrollY)
window.addEventListener('scroll', () => {
  const next = backReveal(state, window.scrollY)       // the same object when nothing moved
  if (next !== state) { state = next; floatingBack.hidden = !state.shown }
}, { passive: true })

The distances are options, with the defaults shown: backReveal(state, y, { revealPast: 96, revealUp: 24, hideDown: 8 }). revealPast is how far down the screen's own Back is out of view, revealUp how far an upward scroll must go to show the copy, hideDown how far a downward one must go to hide it.

The notifications line

import { notifyState, isIOS, keyBytes } from '@supersuit/home-screen-app'

const state = notifyState({
  hasPush: 'serviceWorker' in navigator && 'PushManager' in window && 'Notification' in window,
  standalone: matchMedia('(display-mode: standalone)').matches,
  ios: isIOS(navigator.userAgent, navigator.maxTouchPoints),
  permission: 'Notification' in window ? Notification.permission : 'unknown',
  subscribed: Boolean(await (await navigator.serviceWorker?.ready)?.pushManager.getSubscription()),
})
// 'install' (an iPhone in Safari: web push exists only once the app is on the Home Screen),
// 'ask', 'denied', 'on', or 'hidden' (this browser has no push)

// Subscribing wants the VAPID public key as bytes, not as the URL-safe base64 it is usually stored in.
await registration.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: keyBytes(VAPID_PUBLIC_KEY) })

License

MIT