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

@stati/cli

v1.13.1

Published

**The command-line interface for Stati - a minimal, TypeScript-first static site generator that's fast to learn and even faster to build with.**

Readme

@stati/cli

The command-line interface for Stati - a minimal, TypeScript-first static site generator that's fast to learn and even faster to build with.

Run your development server, build for production, and manage your site's cache with simple commands.


Getting Started

The Easy Way (Recommended)

If you're new to Stati, start by creating a new site with our scaffolding tool:

npx create-stati my-site

cd my-site
npm run dev

This creates a complete Stati project with the CLI already configured in your package.json.

For Existing Projects

Add Stati CLI to an existing project:

npm install --save-dev @stati/cli

Then add these scripts to your package.json:

{
  "scripts": {
    "dev": "stati dev",
    "build": "stati build",
    "preview": "stati preview"
  }
}

One-Time Usage

Use npx to run Stati commands without installation:

npx @stati/cli dev
npx @stati/cli build
npx @stati/cli preview

Commands

stati dev - Development Server

Start a development server with live reload and instant feedback:

npm run dev
# or
stati dev [options]

What it does:

  • Starts a local development server (default: http://localhost:3000)
  • Watches your files for changes and rebuilds automatically
  • Compiles TypeScript with source maps (when typescript.enabled is true)
  • Live reloads your browser when content or templates change
  • Shows build errors in an overlay for quick debugging

Options:

  • --port <number> - Server port (default: 3000)
  • --host <string> - Host address (default: localhost)
  • --open - Open browser automatically
  • --config <path> - Path to custom config file

Examples:

# Start on default port
npm run dev

# Start on custom port and open browser
stati dev --port 8080 --open

# Use custom config
stati dev --config ./my-config.js

stati build - Production Build

Build your site for production deployment:

npm run build
# or
stati build [options]

What it does:

  • Generates static HTML files from your content and templates
  • Optimizes output for production
  • Uses smart caching to skip unchanged pages (ISG)
  • Creates sitemap and robots.txt (if configured)
  • Reports build statistics and performance metrics

Options:

  • --force - Force full rebuild (keeps cache but rebuilds all pages)
  • --clean - Clean cache before building (fresh start)
  • --config <path> - Path to custom config file
  • --include-drafts - Include draft pages in the build

Examples:

# Standard production build
npm run build

# Clean build (removes cache first)
stati build --clean

# Force rebuild without clearing cache
stati build --force

# Include draft pages
stati build --include-drafts

stati preview - Preview Production Build

Preview your built site locally before deployment:

npm run preview
# or
stati preview [options]

What it does:

  • Serves static files from your dist/ directory
  • Tests your production build locally
  • No live reload or rebuilding (serves files as-is)
  • Perfect for final testing before deployment

Options:

  • --port <number> - Server port (default: 4000)
  • --open - Open browser automatically
  • --config <path> - Path to custom config file

Examples:

# Preview on default port
npm run preview

# Preview on custom port and open browser
stati preview --port 8000 --open

stati invalidate - Cache Management

Selectively clear your site's cache to force rebuilds:

stati invalidate [query]

What it does:

  • Removes specific pages from the ISG cache
  • Forces them to rebuild on next build
  • Supports multiple query types for flexible targeting
  • Useful for updating related content together

Query Formats:

  • tag:value - Invalidate pages with specific tag
  • path:value - Invalidate by path (supports prefixes)
  • glob:pattern - Invalidate by glob pattern
  • age:duration - Invalidate content younger than specified age
  • No query - Clear entire cache

Examples:

# Invalidate all blog posts
stati invalidate "tag:blog"

# Invalidate specific path
stati invalidate "path:/posts"

# Invalidate using glob pattern
stati invalidate "glob:/blog/**"

# Invalidate recent content (younger than 3 months)
stati invalidate "age:3months"

# Invalidate week-old content
stati invalidate "age:1week"

# Multiple criteria (OR logic)
stati invalidate "tag:blog age:1month"

# Clear entire cache
stati invalidate

Age Formats:

  • age:30days or age:30day - Content younger than 30 days
  • age:2weeks or age:2week - Content younger than 2 weeks
  • age:6months or age:6month - Content younger than 6 months
  • age:1year or age:1years - Content younger than 1 year

Note: Age calculations use exact calendar arithmetic. Months and years account for varying month lengths and leap years.


Quick Start Guide

Creating Your First Site

  1. Create a new site:

    npx create-stati my-site
  2. Navigate to your project:

    cd my-site
  3. Start developing:

    npm run dev

    Your site will be available at http://localhost:3000

  4. Make changes:

    • Edit site/index.md for your homepage content
    • Modify site/layout.eta for your HTML structure
    • Update public/styles.css for styling
    • Configure stati.config.js for site settings
  5. Build for production:

    npm run build

    Your static site will be in the dist/ directory

  6. Preview production build:

    npm run preview

    Test your production build at http://localhost:4000


Common Workflows

Development Workflow

# Start development server
npm run dev

# Edit your content in site/
# Save files and see changes instantly

# When ready, build for production
npm run build

Deployment Workflow

# Clean build for production
npm run build -- --clean

# Test production build locally
npm run preview

# Deploy dist/ folder to your hosting provider
# (Netlify, Vercel, GitHub Pages, etc.)

Cache Management Workflow

# After updating a template that affects blog posts
stati invalidate "tag:blog"

# Rebuild affected pages
npm run build

# Or do a clean build
npm run build -- --clean

Learn More


Requirements

  • Node.js >=22
  • npm 11.5.1 or higher (or equivalent package manager)

Support & Community


MIT © Imre Csige