monito-checker
v0.1.1
Published
API Health Check Engine — zero-dependency HTTP health checker with CLI. Use standalone or deploy your own Cloudflare Worker.
Maintainers
Readme
Monito Checker
Zero-dependency HTTP health check engine — check APIs from Node.js, the CLI, or your own Cloudflare Worker. Built for monito, the $0/mo BetterStack alternative.
npm install monito-checkerWhy monito-checker?
| | monito-checker | BetterStack | Pingdom | UptimeRobot | |---|---|---|---|---| | Cost | $0 (self-hosted) | $20+/mo | $15+/mo | Free tier limited | | Dependencies | Zero | N/A | N/A | N/A | | Deploy | Cloudflare Workers (free tier) | Fully managed | Fully managed | Fully managed | | CLI | ✅ Built-in | ❌ | ❌ | ❌ | | Self-host | ✅ Full control | ❌ Vendor lock | ❌ Vendor lock | ❌ Vendor lock |
Built because I was tired of paying $20/mo to monitor 11 personal API endpoints. With monito, infrastructure costs = $0/mo. Read the full story.
Quick Start
Option 1: Library (programmatic checks)
import { checkMonitor } from 'monito-checker'
// Check any HTTP endpoint — works anywhere fetch() does
const result = await checkMonitor({
id: 'github',
url: 'https://api.github.com',
method: 'GET',
timeout_ms: 10000,
// Other Monitor fields have sensible defaults
})
console.log(result)
// { success: true, statusCode: 200, responseTime: 234, error: null }Option 2: CLI
# Quick health check from your terminal
npx monito-checker login mk_your_api_key
npx monito-checker add https://api.github.com --name "GitHub API"
npx monito-checker status
# Output:
# 🟢 GitHub API → up (234ms, checked 2026-06-14 06:00:00)
# 🔴 My Service → down (timeout after 10000ms)
# 🟢 API v2 → up (89ms)Option 3: Cloudflare Worker (self-hosted monitoring)
See example/worker.ts — deploy your own health check worker on Cloudflare's free tier.
Features
- ✅ Single endpoint check —
checkMonitor()with timeout, redirect-follow, rate-limit detection - ✅ Batch concurrent checks —
checkAllMonitors()with configurable concurrency (default 5) - ✅ CLI — Manage monitors from the terminal (
monito add,list,status,remove) - ✅ Zero dependencies — Uses only built-in
fetch,AbortController,performance - ✅ Self-hostable — Deploy as your own Worker with
wrangler deploy - ✅ TypeScript first — Full type definitions included
CLI Reference
# Install globally
npm install -g monito-checker
# Or use without installing
npx monito-checker login <your-api-key>
# Commands
monito add https://example.com/health --name "My API"
monito add https://api.example.com --email [email protected] --method HEAD
monito list # List all monitors with status
monito status # Overview: up/down/total
monito remove <monitor-id>
monito login <api-key>
monito --help # Full usage
monito --json status # Machine-readable output
# Self-hosted? Point CLI at your own Worker:
# ~/.config/monito/config.json
# { "apiBase": "https://your-worker.example.com", "apiKey": "..." }CLI status output
$ monito status
Status overview:
Total: 12
🟢 Up: 11
🔴 Down: 1
⚪ Unknown: 0
$ monito list
🟢 a1b2c3d4 https://api.github.com 🟢 up 234ms 6/14/2026, 6:00:00 AM
🟢 e5f6g7h8 https://monito.yycomyy.workers.dev 🟢 up 89ms 6/14/2026, 6:00:01 AM
🔴 i9j0k1l2 https://example.com/health 🔴 down timeout 6/14/2026, 5:59:30 AMAPI
checkMonitor(monitor: Monitor): Promise<CheckResult>
Check a single endpoint. Returns immediately with the result.
import { checkMonitor } from 'monito-checker'
const result = await checkMonitor({
id: 'my-api',
url: 'https://api.example.com/health',
method: 'GET',
timeout_ms: 10000,
})
// → { success: true, statusCode: 200, responseTime: 123, error: null }checkAllMonitors(monitors: Monitor[], concurrency?: number): Promise<Array<{monitorId, result}>>
Check multiple endpoints concurrently in batches. Default batch size: 5.
import { checkAllMonitors } from 'monito-checker'
const results = await checkAllMonitors(myMonitors, 10) // 10 concurrent
for (const { monitorId, result } of results) {
console.log(`${monitorId}: ${result.success ? '🟢 UP' : '🔴 DOWN'} (${result.responseTime}ms)`)
}Types
interface CheckResult {
success: boolean // true if HTTP 2xx-4xx
statusCode: number | null // HTTP response status
responseTime: number // ms
error: string | null // error message on failure
}
interface Monitor {
id: string
url: string
name: string | null
method: 'HEAD' | 'GET'
timeout_ms: number
check_interval: number
status: 'unknown' | 'up' | 'down' | 'deleted'
consecutive_failures: number
// + optional SaaS fields (alert_email, slack_webhook_url, etc.)
}Self-Hosted Worker
Deploy your own health check Worker:
npx wrangler init my-checker
cd my-checker
npm install monito-checkerSee example/worker.ts for a minimal working example, or src/worker-bootstrap.ts for a complete template with CRON scheduling and D1/KV persistence.
Using with Cloudflare D1 + KV
[[d1_databases]]
binding = "DB"
database_name = "monito-db"
database_id = "YOUR_DATABASE_ID"
[[kv_namespaces]]
binding = "MONITO_STATE"
id = "YOUR_KV_NAMESPACE_ID"Production Stats
monito has been running in production monitoring 11 endpoints for weeks:
| Metric | Value | |--------|-------| | Infrastructure cost | $0/mo | | Maintenance | Zero — no SSH, no restarts | | Availability | 99%+ across all monitors | | Cron interval | Every 60 seconds |
Requirements
- Node.js 18+ (native
fetchsupport) - For CLI: Node.js 18+
- For Workers: Cloudflare Workers runtime
Install alternatives:
pnpm add monito-checker
bun add monito-checkerLinks
- monito — Full SaaS Platform — Multi-tenant API health monitoring
- Live Status Dashboard — See it in action
- Blog: How I Built monito — The $20/mo → $0 story
- GitHub Repo — monito platform source
- CLI Source — This package
License
MIT — see LICENSE.
