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

@svforge/chat

v2.0.1

Published

SVForge Chat — composable app chat (conversations, messages, read-state)

Readme

@svforge/chat

Composable app chat for SvelteForge dashboard projects — conversations, messages, read-state. Provides the repetitive 60–70%; it is not a full messaging product (no Slack clone, no threads, no presence engine in v1).

Install

npx sv add @svforge/chat

Requires the dashboard template (auth + Drizzle). Schemas auto-registered.

Deployment profile

Supported: long-lived-node, serverless. Unsupported: edge, separate-worker because the module uses PostgreSQL. Realtime is an optional separately deployed integration.

API

import { chat } from '$lib/server/chat';

// Create a conversation (≥2 participants, creator included)
const conv = await chat.createConversation({ participantIds: [userA, userB] });

// Send a message — authorId is set SERVER-SIDE (no client spoofing)
await chat.sendMessage({ conversationId: conv.id, authorId: currentUser.id, content: 'Bonjour' });

// Reads (membership-checked, paginated)
await chat.listConversations(userId);
await chat.listMessages(conversationId, userId, { limit: 50, offset: 0 });
await chat.markRead(conversationId, userId);

UI

  • /chat — conversation list: last message + timestamp + unread badge
  • /chat/[id] — conversation view: paginated messages + send form (enhance)
  • Empty/loading states; all copy via Paraglide FR/EN

Security

  • Only participants can read a conversationassertMember server-side on every read/write
  • Only the current author can create a message under their identityauthorId comes from locals.user, never from the client
  • Messages are paginated

Composition (all optional)

| Integration | What it adds | |-------------|--------------| | @svforge/realtime | publish message.created on conversation:{id} after persist — client refetches | | @svforge/uploads | attachments via the existing upload primitives (no second upload system) | | @svforge/notifications | notify non-active participants (simple hook pattern) |

The chat works fine without realtime — classic form/refetch flows.

Model

conversations            id, type (direct|group), createdAt
conversation_participants conversationId, userId, joinedAt
messages                id, conversationId, authorId, content, createdAt
message_reads           messageId, userId, readAt

What's included

  • $lib/server/chat/schema.ts — 4 Drizzle tables
  • $lib/server/chat/index.ts — service layer (chat.*)
  • src/routes/chat/ and src/routes/chat/[id]/ — demo pages (small, canonical)

License

MIT