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

@zeropress/theme

v0.5.1

Published

ZeroPress theme developer toolkit

Readme

@zeropress/theme

npm license node

ZeroPress theme development toolkit.

This package provides the public CLI for previewing, validating, and packaging ZeroPress themes.


Install

# Run directly with npx
npx @zeropress/theme --help

# Or install globally
npm install -g @zeropress/theme
zeropress-theme --help

Quick Start

npx @zeropress/theme dev ./my-theme

Usage

zeropress-theme dev <themeDir> [--data <path>] [--host <ip>] [--port <n>] [--strict-port] [--open]
zeropress-theme validate <themeDir|theme.zip> [--strict] [--json]
zeropress-theme pack <themeDir> [--out <dir>] [--name <zipFile>] [--dry-run]

Arguments

  • <themeDir>: Theme directory
  • <theme.zip>: Packaged theme zip file

Options

  • --help, -h: Show help
  • --version, -v: Show version

Examples

zeropress-theme dev ./my-theme --data ./preview-data.json
zeropress-theme validate ./my-theme --strict
zeropress-theme pack ./my-theme --out ./artifacts

Commands

dev

Launches a local preview server with WebSocket-based live reload.

Usage

zeropress-theme dev <themeDir> [--data <path>] [--host <ip>] [--port <n>] [--strict-port] [--open]

Arguments

  • <themeDir>: Theme directory to preview

Options

| Option | Description | Default | | --- | --- | --- | | --data <path> | Local preview-data v0.5 JSON file | Built-in sample data | | --host <ip> | Bind address | 127.0.0.1 | | --port <n> | Preferred server port | 4000 | | --strict-port | Fail when the preferred port is already in use instead of trying the next port | — | | --open | Open the browser automatically | — |

Examples

zeropress-theme dev ./my-theme
zeropress-theme dev ./my-theme --data ./preview-data.json

Notes

  • Builds the theme through @zeropress/build-core and serves the latest in-memory output snapshot
  • Falls back to files in the public directory when a route is not generated
  • The public directory defaults to ./public/; set ZEROPRESS_PUBLIC_DIR to use a different public root
  • Generated output is served before public files when paths overlap
  • robots.txt is a fallback special file: if public robots.txt exists, the dev server serves that file instead of generated fallback robots output
  • Public robots.txt is served as-is. If it needs a Sitemap directive, add it to the file manually.
  • Root-level public favicon files named favicon.ico, favicon.svg, favicon.png, and apple-touch-icon.png are auto-discovered and injected into generated HTML <head> output unless preview-data already defines site.favicon
  • Hidden entries, node_modules, Thumbs.db, *.key, *.pem, and symlinks inside the public directory are ignored
  • The theme directory must not overlap with the resolved public directory
  • Starts on the preferred port, or the next available port unless --strict-port is used
  • Watches theme directory changes and performs a full rebuild with full reload
  • Watches the --data file too when one is provided
  • Watches the public directory too when it exists at startup; creating it after startup requires restarting dev
  • Non-matching routes return 404
  • If 404.html exists at theme root, it is rendered; otherwise a built-in fallback page is used
  • dev only accepts canonical preview-data v0.5
  • --data must point to a local file path
  • Built-in sample data includes enabled primary and footer menus for {{menu:*}} previews
  • Post templates can render a theme-owned comments island by checking {{#if post.comments_enabled}}
  • Output behavior follows build-core parity for archive, category, tag, 404, and special files

validate

Validates a theme directory or packaged zip against Theme Runtime v0.5.

Usage

zeropress-theme validate <themeDir|theme.zip> [--strict] [--json]

Arguments

  • <themeDir|theme.zip>: Theme directory or packaged theme zip file

Options

| Option | Description | | --- | --- | | --strict | Treat warnings as errors | | --json | Output results as JSON |

Examples

zeropress-theme validate ./my-theme
zeropress-theme validate ./dist/my-theme-1.0.0.zip --strict

Errors

  • theme.json missing or invalid
  • Missing or invalid namespace, slug, license, or runtime
  • Missing required templates: layout.html, index.html, post.html, page.html
  • Invalid semver in version
  • assets/style.css missing
  • Invalid slot usage in layout.html
  • <script> inside layout.html
  • Nested slots or Mustache block syntax
  • Path traversal or symlink escape

Warnings

  • archive.html, category.html, tag.html missing
  • macOS metadata files such as __MACOSX/ and ._* are ignored

Exit Codes

| Code | Meaning | | --- | --- | | 0 | No errors or warnings | | 1 | Errors found | | 2 | Warnings only |

With --strict, warnings also return exit code 1.

pack

Creates an upload-ready zip file for a theme directory.

Usage

zeropress-theme pack <themeDir> [--out <dir>] [--name <zipFile>] [--dry-run]

Arguments

  • <themeDir>: Theme directory to package

Options

| Option | Description | Default | | --- | --- | --- | | --out <dir> | Output directory | dist | | --name <zipFile> | Zip filename | {name}-{version}.zip | | --dry-run | Print the output path and included files without writing a zip | — |

Examples

zeropress-theme pack ./my-theme --dry-run
zeropress-theme pack ./my-theme --out ./artifacts

Notes

  • Runs validate before packaging
  • Excludes unnecessary files such as .git, node_modules, dist, *.log, __MACOSX, .DS_Store, and lockfiles
  • Generates a root-flattened zip
  • Re-validates the generated archive
  • With --dry-run, prints the output path and included files without creating a zip

CI Usage

zeropress-theme validate ./theme --strict
zeropress-theme validate ./artifacts/theme-1.0.0.zip --strict
zeropress-theme pack ./theme --dry-run
zeropress-theme pack ./theme --out ./artifacts

Requirements

  • Node.js >= 18.18.0
  • ESM only

Related


License

MIT