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

@pith-cms/next

v0.3.0

Published

Typed server-only Next.js App Router reads, editor, preview, and caching for Pith.

Readme

@pith-cms/next

Server-only Pith integration for Next.js App Router. Supply a validated Pith configuration and any ContentRepository; this package does not choose storage or render Markdown.

pnpm add @pith-cms/core@latest @pith-cms/next@latest server-only
import { createPith } from '@pith-cms/next/server';

export const pith = createPith({
  config,
  repository,
  cache: { mode: 'request' },
});

Use @pith-cms/next/server only in Server Components, route handlers, metadata, and static generation. Configured Pith instances must not enter client bundles.

Read content

const entry = await pith.content.getEntry('posts', 'building-pith');
const optional = await pith.content.getOptionalEntry('posts', 'building-pith');
const { entries, invalidEntries } = await pith.content.listEntries('posts');

getEntry throws ContentNotFoundError when the file is absent. getOptionalEntry returns null only for that case. Parse, validation, path, and repository failures remain errors. getEntryOrNotFound explicitly converts only missing content into Next.js notFound().

Cache modes are request, no-store, and persistent. Persistent canonical reads use root, collection, and entry tags; Pith mutations invalidate affected tags. External changes still need a revalidation interval, explicit invalidation, deployment, or future webhook.

Editor

// app/(cms)/layout.tsx
import '@pith-cms/next/editor.css';

// app/(cms)/pith/[[...pithPath]]/page.tsx
export default pith.editor.page;

// app/api/pith/[...pithRoute]/route.ts
export const { GET, POST, PUT, DELETE } = pith.editor.handlers;

Configure an auth adapter. createPasswordAuth verifies a precomputed Argon2id hash and creates encrypted HttpOnly sessions. Generate a hash with the CLI:

pnpm pith auth hash-password
pnpm pith auth generate-secret

The editor validates permissions, CSRF, origin, content type, body size, and repository revisions on the server. It does not force overwrite conflicts. Markdown fields use a lazy-loaded source editor; optional field-level dialect and feature metadata controls its formatting toolbar and warnings without making this package a Markdown renderer.

Preview

Configure a separate preview secret and path resolver. Public pages that should honor previews call:

const content = await pith.content.forRequest();

The ordinary pith.content client always reads canonical storage. Preview is authenticated, private, noindex, and short lived. The built-in memory store is for one process only; use a shared PithPreviewStore across replicas.

Pith runs on the Node.js runtime. Filesystem-backed runtime writes need persistent storage. See the Pith guides for setup, security, storage, and deployment limits.