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

@speles7172/message-console

v0.3.1

Published

React UI for notifications, inquiries and email — a bell, a thread panel that hangs off any record, and the administrator's template editor, over a transport you supply.

Readme

@speles7172/message-console

The screens for the notification, inquiry and email module: a bell with its dropdown, the notifications page behind it, the settings that decide what reaches whom, a conversation panel that hangs off any record, and the administrator's editor for the wording of every notification the application sends.

npm install @speles7172/message-console
import { NotificationBell, ThreadPanel } from '@speles7172/message-console';
import '@speles7172/message-console/styles.css';

React 18 or 19, as a peer dependency.

The transport

A browser cannot query Postgres and must never hold a mail credential, so the console queries nothing itself. The consuming application exposes endpoints backed by @speles7172/message-client and supplies one object:

// Module scope, not inline in JSX — see below.
const transport = {
  notifications: (query) => api.get('/notifications', query),
  unreadCount: () => api.get('/notifications/unread'),
  markRead: (ids) => api.post('/notifications/read', { ids }),
  markAllRead: () => api.post('/notifications/read-all'),

  thread: (id) => api.get(`/threads/${id}`),
  postMessage: (input) => api.post(`/threads/${input.threadId}/messages`, input),
  people: {
    search: (query) => api.get('/options/people', query),
    resolve: (values) => api.get('/options/people/resolve', { values }),
  },
};

<NotificationBell transport={transport} pollMs={60_000} onSeeAll={() => navigate('/notifications')} />

Every method except notifications is optional, and each one is a capability. A transport with no postMessage renders a read-only transcript; one with no people renders no participant picker and no @ autocomplete. The alternative — a button that always fails — is worse than a button that is not there.

There are two kinds of endpoint here, and they belong behind different gates. The notification and thread methods act as the signed-in person: take the recipient id from the session and never from the request, because a recipientId a browser can choose is a way to read anybody's notifications. The template methods are administrative. This package applies no access control of its own.

Hold the transport still. Every component keys its effects on the object's identity, so an object literal written inline in JSX is a new transport on every render and therefore an endless reload. Put it in a module constant or behind useMemo.

What is in it

| | | |---|---| | <NotificationBell> | The bell, its badge and the dropdown. Loads the list only once opened — a bell is on every page, and fetching twenty rows to render a number is a request per page view. | | <NotificationsConsole> | The same rows on a page of their own, with search, a read/unread filter and a pager. | | <NotificationPreferences> | A master switch per channel, and a row per event. Each toggle is its own request, because a page that PUTs the whole object loses every change made in another tab. | | <ThreadPanel> | One conversation: its messages, its people, the status, and the box to reply in. Says "via email" on a message that arrived that way. | | <InquiryButton> | The entry point from a record to its conversations. Drop it on an invoice and that invoice has inquiries. | | <NewInquiryForm> | Subject, people and a first message, in one submit. | | <MessageComposer> | A plain textarea with @ mentions. Enter sends; Shift+Enter is a newline. | | <MentionText> | A body with its mentions rendered as mentions rather than as raw markup. | | <TemplatesConsole> | The wording of every notification, with a live preview that runs the real renderer. | | <RoutingConsole> | Who hears each event: the named groups, and the rule pointing an event at one. The other half of the templates page — that one decides what a notification says, this one decides who gets it. | | useNotifications, useThread, useRouting | The behaviour without the markup, for an application with its own design system. |

Theming

One stylesheet, one class, custom properties throughout:

.my-app .msgc {
  --msgc-accent: #7c3aed;
  --msgc-radius: 10px;
}

The dark palettes are wrapped in :where() so nothing in the stylesheet out-specifies a host that overrides a token. theme takes light (the default), dark, or autoauto follows prefers-color-scheme, which is right only when the host follows it too.

The stylesheet already contains @speles7172/controls, whose pickers this console renders. Importing both is harmless — the shared rules are byte- identical and at identical specificity.

Licence

MIT