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

@e9n/pi-heartbeat

v0.1.1

Published

Periodic health check extension for pi — runs a heartbeat prompt as an isolated subprocess

Downloads

155

Readme

@e9n/pi-heartbeat

Periodic health check extension for pi. Runs a configurable prompt as an isolated subprocess on an interval and alerts via pi-channels when something needs attention.

Features

  • Spawns a pi --no-session subprocess to run health checks in isolation
  • Reads HEARTBEAT.md from cwd as a per-project checklist; falls back to a generic check if missing
  • Suppresses HEARTBEAT_OK responses; escalates anything else as an alert via pi-channels
  • Delivers alerts via the channel:send event (integrates with pi-channels)
  • Optional persistent run history via pi-kysely
  • Web dashboard at /heartbeat via pi-webserver
  • Disabled by default — enable with --heartbeat flag, /heartbeat on, or autostart: true

Setup / Settings

Add to ~/.pi/agent/settings.json (global) or .pi/settings.json (project):

{
  "pi-heartbeat": {
    "autostart": false,
    "intervalMinutes": 15,
    "activeHours": { "start": "08:00", "end": "22:00" },
    "route": "ops",
    "showOk": false,
    "prompt": null,
    "webui": false,
    "useKysely": false,
    "extensions": null
  }
}

| Key | Default | Description | |-----|---------|-------------| | autostart | false | Start automatically on session start. | | intervalMinutes | 15 | Minutes between checks. | | activeHours | {"start":"08:00","end":"22:00"} | Only run checks inside this window. null for 24/7. | | route | "ops" | pi-channels route for alert delivery. | | showOk | false | Also send a notification on HEARTBEAT_OK (not just alerts). | | prompt | null | Custom prompt override — bypasses HEARTBEAT.md. | | webui | false | Mount web dashboard on pi-webserver at /heartbeat. | | useKysely | false | Persist run history via pi-kysely instead of in-memory. | | extensions | null | Extensions to load in the subprocess. null = none. |

HEARTBEAT.md

Place a HEARTBEAT.md in your project root with a checklist of things to verify:

# Heartbeat Checklist

- Check that the API server responds on port 3000
- Verify database connectivity
- Confirm disk usage is below 90%

If the file is missing or contains only headers/blank lines, checks are skipped.

Commands

| Command | Description | |---------|-------------| | /heartbeat on | Start periodic checks | | /heartbeat off | Stop checks | | /heartbeat status | Show interval, run count, OK/alert totals, last result | | /heartbeat run | Run a check immediately |

Pass --heartbeat at startup to enable automatically: pi --heartbeat.

Web UI

Enable with "webui": true. Requires pi-webserver ("pi-webserver": { "autostart": true }).

Dashboard at http://localhost:4100/heartbeat — live status, stats (runs / OK / alerts / rate), last check result, expandable history (up to 100 entries), and start / stop / run controls.

REST API at /api/heartbeat:

| Method | Body | Description | |--------|------|-------------| | GET | — | Status, stats, and history | | POST | { "action": "start" } | Start heartbeat | | POST | { "action": "stop" } | Stop heartbeat | | POST | { "action": "run" } | Run a check immediately |

Events

| Event | Payload | Description | |-------|---------|-------------| | heartbeat:check | { time } | Emitted when a check starts | | heartbeat:result | { ok, response, durationMs, time } | Emitted when a check completes | | channel:send | { route, text, source: "pi-heartbeat" } | Alert dispatched to pi-channels |

Install

pi install npm:@e9n/pi-heartbeat

License

MIT