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

upstatus

v0.2.0

Published

Simple uptime monitoring CLI

Downloads

6

Readme

upstatus

Simple uptime monitoring CLI

npm version npm downloads build node bundle size license

Install

npm install -g upstatus

Quick Start

# Monitor a single URL
upstatus https://api.example.com

# Monitor multiple URLs
upstatus https://api.example.com https://site.com

# Custom interval (default 30s)
upstatus https://api.example.com -i 60

# Demo mode (no URLs)
npx upstatus

Features

  • Response time tracking
  • Uptime percentage calculation
  • Status detection (up/down/degraded)
  • HTTP methods (GET, POST, PUT, PATCH, DELETE)
  • Request body support
  • Configurable thresholds
  • Retry logic with exponential backoff
  • JSON/CSV export
  • CI/script friendly (JSON output mode)
  • Pretty terminal output (powered by logfx)

Usage

Basic Monitoring

upstatus https://api.github.com https://httpstat.us/200

Custom Interval

# Check every 60 seconds
upstatus https://api.example.com -i 60

POST Requests

upstatus https://api.example.com/health -m POST -b '{"check":"deep"}'

Degraded Threshold

Mark responses as "degraded" if they exceed a threshold:

# Mark as degraded if response > 1000ms (default: 2000ms)
upstatus https://api.example.com -d 1000

Export Results

Export stats when you stop monitoring (Ctrl+C):

# Export to JSON
upstatus https://api.example.com --export json -o results.json

# Export to CSV
upstatus https://api.example.com --export csv -o results.csv

JSON Output Mode

For CI/CD pipelines and scripts:

upstatus https://api.example.com --json

Non-TTY Environments

Disable terminal clearing for logs/CI:

upstatus https://api.example.com --no-clear

CLI Options

| Option | Short | Description | Default | |--------|-------|-------------|---------| | --interval | -i | Check interval in seconds | 30 | | --degraded-threshold | -d | Response time threshold (ms) for degraded status | 2000 | | --method | -m | HTTP method (GET, POST, PUT, PATCH, DELETE) | GET | | --body | -b | Request body for POST/PUT/PATCH | - | | --export | - | Export format (json, csv) | - | | --output | -o | Output file path | - | | --json | - | JSON output mode | false | | --no-clear | - | Disable terminal clearing | false | | --version | -v | Show version | - | | --help | -h | Show help | - |

Programmatic Usage

import { Monitor, MonitorManager } from 'upstatus'

const manager = new MonitorManager()

manager.add({
  url: 'https://api.example.com',
  interval: 30,
  timeout: 10000,
  expectedStatus: 200,
  degradedThreshold: 2000,
  maxRetries: 2,
  retryDelay: 1000,
})

manager.startAll()

// Get stats
const stats = manager.getMonitor('api.example.com')?.getStats()
console.log(stats)

// Stop all monitors
manager.stopAll()

Monitor Configuration

interface MonitorConfig {
  url: string
  name?: string
  interval?: number              // seconds (default: 30)
  timeout?: number               // ms (default: 10000)
  expectedStatus?: number | number[]  // (default: 200)
  headers?: Record<string, string>
  degradedThreshold?: number     // ms (default: 2000)
  method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
  body?: string
  contentType?: string           // (default: 'application/json')
  followRedirects?: boolean      // (default: true)
  maxRedirects?: number          // (default: 5)
  maxRetries?: number            // (default: 0)
  retryDelay?: number            // ms (default: 1000)
}

Export Utilities

import { exportToJson, exportToCsv } from 'upstatus'

const stats = manager.monitors.values().map(m => m.getStats())

const json = exportToJson(stats)
const csv = exportToCsv(stats)

Status Types

| Status | Meaning | |--------|---------| | up | Response received with expected status code | | degraded | Response received but slower than threshold | | down | Request failed or unexpected status code |

License

MIT