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

@popcraft/runtime

v0.41.0

Published

What code exported from PopCraft shares: the meaning of expressions (operators and functions) and, as it grows, the parts of a design's behaviour that are common code rather than generated React.

Readme

@popcraft/runtime

The code projects exported from PopCraft share. An exported Next.js project is plain React first; what has to be common code lives here, versioned, and is the same code PopCraft itself runs.

You do not install this by hand: an exported project's package.json asks for it.

What is in it

| Import | What it is | | --- | --- | | @popcraft/runtime | What an expression means (ops, truthy, num, exprText, FUNCTIONS); the players for a prototype (popcraftMount) and a state machine (popcraftMachine); the page controls (switchMode, controlTimeline, scrubTimeline, orbitDrag); the site contract (endpoints, sign-in and record rules); and createSiteClient, what a page asks of its site's server | | @popcraft/runtime/commerce | What storefront components bind to: Next.js Commerce's types (Product, Cart, CartItem, Collection, Menu), the fields a design reads for each (COMMERCE_FIELDS), commerceItem to flatten one into them, formatMoney, and the storefront form actions | | @popcraft/runtime/server | For Node: siteRequest, which answers a site's own requests (forms, sign-in, each visitor's records); the Neon Auth relay; neonStore, a site's forms and records in its own Postgres database |

An exported project with forms or accounts answers /_pc/… in one route handler:

import { siteRequest } from '@popcraft/runtime/server'
import { site } from '@/lib/popcraft-server'

async function handle(request: Request, { params }: { params: Promise<{ path: string[] }> }) {
  const { path } = await params
  return (await siteRequest(request, `_pc/${path.join('/')}`, site)) ?? Response.json({ error: 'Not found' }, { status: 404 })
}

export { handle as DELETE, handle as GET, handle as POST }

Examples

In getpopcraft/examples: a digest worked out with an exported app's expressions, and an exported site's forms answered from a plain Node server with a JSON-file SiteDatabase in place of Neon.

Versions

Semantic versioning. A change an exported project would notice (a function's result, a removed export) is a new major; an exported project asks for ^ the version it was exported with, so it takes fixes and never a breaking change. Release notes: CHANGELOG.md.