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

@wptom/cms-emdash

v0.2.0

Published

EmDash CMS for WPTom templates: collections, fields, block types and the demo seed generated from the template's content model, and the mapping that turns EmDash entries back into the model's shape.

Readme

@wptom/cms-emdash

EmDash for WPTom templates. In a template's EmDash variant (wptom new my-site -t <template> --cms emdash), EmDash runs inside the site: the admin lives at /_emdash/admin, pages are rendered on request on Cloudflare Workers (D1 + R2), and what you publish is live at once. This package connects EmDash to the template's content model (src/content/model.ts), so pages don't change. Part of the WPTom integrations. Tested with EmDash 1.3.

  • Some fields live where EmDash keeps them: the site's name and tagline in Settings (single-language sites), nav, legal, social and footer link groups in Menus (primary, legal, social, footer), a post's tags and author in Tags and Bylines, a draft switch in EmDash's drafts, and pages' seoTitle and seoDescription in the SEO panel. Only fields of exactly that shape move; sites set up before keep their own values until the menu or setting exists.
  • A spec's route (/about, /blog/{slug}) becomes the collection's URL pattern: Live View, previews and menu links follow it.
  • emdashSchema(specs, { bodies, multilingual }): collections, fields and block types from the model. Single pages are collections with one entry; nested objects are flattened into fields (pricing.eyebrow → pricing__eyebrow); lists of plain values or flat objects are repeaters; page sections are blocks (section_<type>); deeper structures are JSON fields. Pages with more than 60 fields keep each top-level group in a one-item block, since D1 allows 100 columns per table. Bodies are Portable Text (EmDash's rich editor) or Markdown text.
  • emdashSeed(parts, { title, tagline, media }): the template's demo content as an EmDash seed file (.emdash/seed.json), with photos as $media downloads. EmDash applies it in its setup wizard.
  • fromEmDashEntry(spec, fields, data, options, { settings, menus }, { multilingual }): turns an entry from EmDash's live collections back into the model's shape (images as { src, width, height } or URLs), with the fields EmDash keeps elsewhere and fallbacks for empty SEO texts. fromEmDash does the fields alone.
  • @wptom/cms-emdash/astro: routeCache({ provider }) turns on Astro's route cache for every page in src/pages (an hour fresh, a day stale-while-revalidate), tagged with every collection, the settings, menus and tags, so EmDash's purges on publish refresh the whole site within seconds.
  • setupEmDash(options, schema): brings a running EmDash in line after the model changed (the template's npm run emdash:schema): adds collections, fields and block types, updates changed ones and gives block types a new version when EmDash needs one. Content stays. Needs an API token with schema:write (Settings → API Tokens).
  • markdownToPortableText(), portableTextToPlain(): body conversion (the plain text feeds search and the site chat). Headings, paragraphs, lists, quotes, code, images and inline marks (**bold**, *italic* or _italic_, code, links, strike-through); --- becomes EmDash's break block; footnotes ([^1] and [^1]: text) become footnoteRef inline objects and one footnotes block at the end, numbered by first reference. Render the last two with your own components (PortableText components.type).

EmDash's rich editor has no tables yet. No dependencies besides @wptom/content-model. MIT License; portable-text.ts is adapted from EmDash (MIT, notice in LICENSE).