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

@weaveintel/a11y

v0.1.1

Published

Framework-agnostic accessibility utilities for weaveIntel UIs — pure, dependency-free helpers (focus restoration across full re-renders, etc.).

Readme

@weaveintel/a11y

Tiny, dependency-free DOM helpers for the accessibility problems that break when a UI re-renders — focus restoration, focus trapping, and scroll preservation.

Why it exists

When a live agent UI redraws itself, small courtesies quietly break: the button you were tabbed to vanishes and your keyboard focus falls back to the top of the page; the chat you'd scrolled to the bottom of jumps somewhere else. It's like a librarian reshelving the whole room while you're mid-sentence — you lose your finger on the page. These helpers are pure functions that let you remember where the reader was before the re-render and put them back after: which element had focus, whether the log was pinned to the bottom, where to scroll to. They touch no framework and pull in no dependencies.

When to reach for it

Reach for it when you're hand-rolling a UI (vanilla DOM, or a framework where you manage focus/scroll yourself) and need correct, testable accessibility behaviour across re-renders. Because these are low-level primitives, you wire them into your own event handlers. If a framework already gives you focus management you trust, you may not need this. For UI event builders (approvals, widgets), see @weaveintel/ui-primitives.

How to use it

import { captureFocusKey, focusSelector, captureScroll, isAtBottom, resolveScrollTop } from '@weaveintel/a11y';

// Before a re-render: remember focus + the scroll position.
const focusKey = captureFocusKey({ focusKey: el.getAttribute('data-focus-key'), id: el.id });
const scroll = captureScroll(logEl);

// ...re-render the DOM...

// After: restore focus, and put scroll back (pinned to bottom if the reader was following it).
const sel = focusKey && focusSelector(focusKey);
if (sel) (logEl.querySelector(sel) as HTMLElement | null)?.focus();
logEl.scrollTop = resolveScrollTop(scroll, logEl.scrollHeight, logEl.clientHeight);

What's in the box

| Export | What it does | | --- | --- | | captureFocusKey, focusSelector, cssEscapeValue | Remember the focused element and rebuild a safe selector to restore it | | FocusDescriptor | The type describing a captured focus target | | FOCUSABLE_SELECTOR, nextTrapIndex | Focus-trap wrap-around math for modal dialogs | | captureScroll, resolveScrollTop, isAtBottom, DEFAULT_AT_BOTTOM_THRESHOLD | Preserve scroll position and detect "pinned to bottom" | | ScrollSnapshot | The type describing a captured scroll position |

The DOM reads and writes (reading document.activeElement, calling .focus(), restoring the caret) stay in your app — this package is pure arithmetic and string logic, so it has zero browser dependency and is trivial to test.

License

MIT.