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

page-ok

v0.1.3

Published

Evaluate web pages for console errors, page errors, and failed requests via Puppeteer

Readme

page-ok

Evaluate web pages for console errors, page errors, and failed requests.

A lightweight CLI tool that opens a URL in a headless browser (Puppeteer), collects all runtime errors and warnings, and reports whether the page is OK.

Install

npm install -g page-ok

# or use directly with npx
npx page-ok https://example.com

Usage

page-ok <command> [options] [url]

Commands

| Command | Description | |---|---| | (none) | Check the target URL (default) | | setup | Install system dependencies (Chrome libraries) + download Chromium | | self-check | Quick environment health check |

First-time users: Run page-ok setup before your first check to ensure Chromium and system dependencies are installed.

Examples

# First-time setup (install Chrome deps + download Chromium)
page-ok setup

# Verify environment is ready
page-ok self-check

# Check localhost (default: http://localhost:5173)
page-ok

# Check any URL
page-ok https://example.com
npx page-ok http://localhost:3000 -f json

# Only care about errors, ignore warnings
page-ok https://example.com -F error

# Output as JSON for CI pipelines
page-ok https://example.com -f json > report.json

# Show browser window for debugging
page-ok --no-headless https://localhost:5173

Options

| Option | Alias | Default | Description | |---|---|---|---| | --url | -u | http://localhost:5173 | Target URL to check | | --wait | -w | 5000 | Wait time after page load (ms) | | --timeout | -t | 30000 | Navigation timeout (ms) | | --format | -f | summary | Output format: text, json, or summary | | --filter | -F | all | Filter output: all, error, or warn | | --headless | | true | Run in headless mode | | --no-headless | | | Show browser window (for debugging) | | --no-colors | | | Disable colored output | | --help | -h | | Show help | | --version | -V | | Show version |

Output Formats

Summary (default)

Human-readable verdict:

  [page-ok] https://example.com

  Status:       ✗ NOT OK
  Console Errs: 1
  Warnings:     6
  Page Errors:  0
  Failed Reqs:  0

  Console Error Details:
    1. Cannot read property 'x' of undefined

---JSON---
{"url":"https://example.com","ok":false,"errorCount":1,...}
---END_JSON---

The JSON block at the bottom is designed for easy parsing by AI tools and CI scripts.

JSON

Full structured output:

{
  "url": "https://example.com",
  "timestamp": "2026-04-16T...",
  "ok": false,
  "summary": {
    "totalMessages": 42,
    "errors": 1,
    "warnings": 6,
    "pageErrors": 0,
    "failedRequests": 0
  },
  "details": { ... }
}

Text

Raw streaming output — messages are printed in real-time as they occur.

Exit Codes

| Code | Meaning | |---|---| | 0 | OK — No console errors or uncaught exceptions | | 1 | Not OK — Errors found on the page | | 2 | Fatal — Could not load the page at all |

This makes it trivial to use in shell scripts and CI:

page-ok https://staging.example.com || echo "Build has errors!"

What It Checks

| Source | What's collected | |---|---| | Console | All console.* calls (error, warn, log, etc.) | | Page Errors | Uncaught JavaScript exceptions (window.onerror) | | Failed Requests | Network requests that returned error status codes |

Use Cases

  • CI/CD smoke test — After deploying a PR, verify no console errors appear
  • Local dev — Quickly check if your dev server is clean before committing
  • Monitoring — Cron job that checks production pages periodically
  • AI-assisted debugging — The summary JSON output is optimized for LLM consumption

How It Works

┌─────────────┐     Puppeteer      ┌──────────────┐
│  Target URL │ ──────────────────▶│ Headless Page │
│  (any URL)  │                    │              │
└─────────────┘                    │ Collect:     │
                                    │ • console.*  │
                                    │ • pageerror  │
                                    │ • req failed │
                                    └──────┬───────┘
                                           │
                                           ▼
                                    ┌──────────────┐
                                    │   Report:    │
                                    │ ✓ OK / ✗ ERR │
                                    │ + details    │
                                    └──────────────┘

Why domcontentloaded?

The tool uses domcontentloaded instead of networkidle2 for navigation. This avoids timeouts on pages with persistent WebSocket connections (e.g., Vite HMR, live reload). The --wait option gives control over how long to wait after DOM ready for async scripts to execute.

Requirements

  • Node.js >= 16
  • Chromium (bundled via puppeteer, auto-downloaded via page-ok setup)

Docker

When running page-ok in a container (e.g., CI/CD), you need both Chrome system libraries and the bundled browser:

RUN apt-get update && apt-get install -y \
    libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
    libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
    libgbm1 libpango-1.0-0 libcairo2 libasound2t64 fonts-liberation \
  && rm -rf /var/lib/apt/lists/*
# Then npm install will auto-download Chromium via puppeteer

Or simply run inside the container:

page-ok setup   # handles everything automatically

License

MIT