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/kit

v0.41.0

Published

The PopCraft design kit: everything PopCraft's own templates are made with — the Kit, every helper, style system and theme kit, every official template source to read and remix, the build and every check the official templates pass — plus the design-scrip

Readme

@popcraft/kit

The library PopCraft designs are made with. PopCraft's own templates are written with this Kit, and so are the design scripts its in-editor agent and the popcraft command line run. Code written against it builds ordinary, editable PopCraft layers: brand colour roles, text styles, auto-layout stacks, components, motion, size variants and music.

npm i @popcraft/kit      # Node 24 or newer

Two ways to use it

Run a design script, the same text the write_design command takes, in a sandbox, and get the document and the checks back:

import { runDesign, toPopcraft } from '@popcraft/kit'
import { writeFileSync } from 'node:fs'

const { document, issues, error } = await runDesign(`
k.brand({ paper: '#F4F1EA', ink: '#141414', hot: '#E8361E' })
k.textStyle('Hook', { size: 120, fontWeight: 900, lineHeight: 110 })
k.flowSheet(k.sheet, 32, 96, 'paper')
k.text(k.sheet, 'Half price, this week only.', { style: 'Hook', color: 'ink', width: 'FILL' })
`, { size: 'ig-post', name: 'Sale' })

if (error) throw new Error(`line ${error.line}: ${error.message}`)
for (const i of issues) console.log(i.kind, i.message)   // contrast, small text, safe areas, overlap, seams…
writeFileSync('sale.popcraft', toPopcraft(document!))

Build directly, with the Kit and its helpers as ordinary imports:

import { Kit, preset, web, beat } from '@popcraft/kit'

const k = new Kit('Landing', preset('web-desktop'))
// … k.brand, k.textStyle, web.page, web.nav, k.stack, k.text …
const document = k.finish()

Templates, as PopCraft's own are made

Everything PopCraft's gallery is made with is in this package:

  • Every official template's source. 1,275 of them, importable as @popcraft/kit/templates/<path> and readable in src/templates/. dist/templates/index.json catalogues them by id.
  • Every module they use. The Kit, the helpers, twelve SaaS style systems, fifty-odd theme kits, the comic and anime engines, the Lottie kit, 3D devices and stages, and the music library. The app modules the sources import are @popcraft/kit/lib/<path>.
  • The official build (buildFromSource), with real type first (prepareFonts) and PopCraft's music fetched as needed.
  • Every check the official templates pass (checkTemplate): practices, contrast, type size, safe areas, the trim, finished timelines and golden poses for every cue, real-type layout and hugging, responsive web, brand-kit re-skins and editability.
import { prepareFonts, buildFromSource, checkTemplate } from '@popcraft/kit'
import official from '@popcraft/kit/templates/social/promo-sale-drop'

const mine = { ...official, id: 'my-sale-drop' }
await prepareFonts()                                 // real type: every character the official templates draw
const template = await buildFromSource(mine)        // what template.json holds; `popcraft template publish` uploads it
console.log(await checkTemplate(template, { source: mine }))   // [] when it passes every official check

The command line runs all of it, plus the gallery's pictures and a review render of every size: popcraft template list|new|check|look|pictures|publish. The guide is Making templates.

A design script (below) can also become a template with toTemplate(document, listing).

Types for scripts

A design script runs with k, W, H, NAME, TRACKS and the helpers as globals. Start one with

/// <reference types="@popcraft/kit/design-script" />

for completion and checking in your editor.

What is in it

| Export | What it is | | --- | --- | | Kit, hex, preset, ease | The kit, a colour from hex, a size by its preset id, animation curves | | draw, marks | Vector paths: boxes, lines, curves; grids, dots, confetti, bursts, arrows, charts | | texture, overlays | Shadows, glows, halos, grain; scanlines, rain, snow, halftone | | motion, beat, captions, pointer | Motion recipes, music beds and beat timing, caption tracks, cursor paths | | fit, type, windows, devices | Laying a design out at another size, font pairs, app and browser windows, device frames | | web, site | Web pages (nav, buttons, responsive sizes) and page parts (type scales, columns, footers) | | social, video, effects | Post and feed variants; reel sheets, cuts and camera moves; shader backdrops | | runDesign, checkDesign, tracks | Run a script in a sandbox; the design checks; every music track's tempo | | toPopcraft, fromPopcraft | A document as a .popcraft file's text, and back | | defineTemplate, buildFromSource (buildTemplateSource without fetching), prepareFonts, checkTemplate, media, templatePopcraft | Templates as the official ones are made: a source, its build, every official check, your own media, a file to look at | | toTemplate | A design script's document as a template | | mediaHash, TEMPLATE_CATEGORIES, TEMPLATE_PLATFORMS, TEMPLATE_FORMATS, TEMPLATE_USE_CASES | A media file's media:// hash; the gallery's vocabulary |

Examples

In getpopcraft/examples: event cards from a JSON file, a design check for CI, a typed design script.

Documentation

Release notes: CHANGELOG.md.