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

@purityjs/cli

v0.4.0

Published

Scaffold a new Purity project

Readme

@purityjs/cli

npm version npm downloads license

Scaffold a new Purity project in seconds.

Usage

npx @purityjs/cli my-app
cd my-app
npm install
npm run dev

For a server-rendered project, add --ssr when creating it. After building, npm start runs the generated JavaScript server, which renders pages and serves client assets. Set PORT to change the default port of 3000.

npx @purityjs/cli my-ssr-app --ssr
cd my-ssr-app
npm install
npm run build
npm start

For an app that chooses static HTML, per-request HTML, or browser rendering per page, use --app:

npx @purityjs/cli my-site --app
cd my-site
npm install
npm run build
npm start

Set renderMode in each src/pages/ module to static, server, or client. Dynamic static pages list their paths in src/static-paths.ts, which only runs during the build. dist/client/ holds generated HTML and client assets; dist/server.js serves the complete app. Server pages stream deferred suspense() content after the shell while preserving loader status, headers, and head() content. A fully static app can deploy dist/client/ to a static host. See the generated README for details.

The app starter also includes a /greeting form that works without JavaScript. Export serverAction() handlers from src/actions/**/*.server.ts; the generated server registers them automatically and forwards bounded request bodies before page rendering. Actions require a matching Origin header and default to a 1 MiB body limit (MAX_ACTION_BODY_BYTES). The generated README covers native forms, JSON responses, validation, and deployment behind a proxy.

On a Node 24+ host, deploy the generated project and run npm ci, npm run build, then npm start. If building before deployment, copy dist/, package.json, and package-lock.json to the host and run npm ci --omit=dev followed by npm start. The generated README has these steps too. npm run preview remains a local alias for the SSR start command.

What It Generates

my-app/
  index.html          — entry HTML
  package.json        — dependencies + scripts
  tsconfig.json       — TypeScript config
  vite.config.ts      — Vite + @purityjs/vite-plugin
  .gitignore
  src/
    main.ts           — counter component example

Generated vite.config.ts

import { purity } from '@purityjs/vite-plugin';
import { defineConfig } from 'vite';

export default defineConfig({
  plugins: [purity()],
});

Generated main.ts

A working counter component demonstrating state, compute, html, css, component, and onMount.

Scripts

| Command | Description | | ------------------- | ----------------------------- | | npm run dev | Start Vite dev server | | npm run typecheck | Check TypeScript types | | npm run build | Type-check and build with AOT | | npm run preview | Preview production build | | npm start (SSR) | Run the built Node server | | npm start (app) | Serve all app rendering modes |

Local Development

When run from the Purity monorepo, the CLI automatically:

  • Links @purityjs/core to the local source
  • Links @purityjs/vite-plugin to the local source
  • Generates a vite.config.ts with resolve aliases

No need to publish packages for local development.

License

MIT