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

@chengyixu/api-health

v1.0.0

Published

Monitor API endpoints from the command line. Check response times, status codes, SSL certificate expiry, and get a beautiful dashboard.

Downloads

53

Readme

@chengyixu/api-health

Monitor API endpoints from the command line. Check response times, status codes, SSL certificate expiry, and get a beautiful dashboard.

Features

  • Dashboard view — Color-coded status, response times, SSL expiry at a glance
  • SSL certificate checking — See issuer, expiry date, TLS protocol, days until expiry
  • Multiple endpoints — Check many APIs in parallel with configurable concurrency
  • Watch mode — Continuously monitor endpoints at any interval
  • JSON output — Pipe results to other tools or store for analysis
  • Detailed reports — Full response headers, security headers, content info
  • Config file support — Save your endpoints in api-health.json for easy re-runs
  • CI/CD friendly — Exits with code 1 if any endpoint is down or returns 5xx

Install

npm install -g @chengyixu/api-health

Usage

Quick check

# Check one or more endpoints
api-health check https://api.example.com https://api2.example.com

# Auto-prepends https:// if missing
api-health check api.github.com google.com

Dashboard output

  API Health Dashboard
  2024-01-15T10:30:00.000Z

┌───┬─────────────────────────────────┬──────────┬──────────┬──────────┬────────────┐
│   │ Endpoint                        │ Status   │ Time     │ Size     │ SSL Expiry │
├───┼─────────────────────────────────┼──────────┼──────────┼──────────┼────────────┤
│ ✔ │ https://api.github.com          │ 200      │ 142ms    │ 2.1KB    │ 76d        │
├───┼─────────────────────────────────┼──────────┼──────────┼──────────┼────────────┤
│ ✔ │ https://httpbin.org/get         │ 200      │ 312ms    │ 243B     │ 151d       │
├───┼─────────────────────────────────┼──────────┼──────────┼──────────┼────────────┤
│ ✘ │ https://down.example.com        │ ERR      │ -        │ -        │ -          │
└───┴─────────────────────────────────┴──────────┴──────────┴──────────┴────────────┘

  Summary: 2/3 healthy | 1 errors | avg 227ms

  SSL Warnings:
    ⚠ https://expiring.example.com — SSL expires in 12 days

SSL certificate check

api-health ssl google.com github.com stripe.com

JSON output (for scripting/CI)

api-health check --json https://api.example.com

Detailed report

api-health check --detailed https://api.example.com

Shows response headers, security headers, full SSL certificate info.

Watch mode

# Monitor every 30 seconds (default)
api-health watch https://api.example.com

# Custom interval
api-health watch -i 10 https://api.example.com https://api2.example.com

Config file

Create an api-health.json in your project:

api-health init

This generates:

{
  "endpoints": [
    {
      "url": "https://api.github.com",
      "name": "GitHub API",
      "expectedStatus": 200
    },
    {
      "url": "https://httpbin.org/get",
      "name": "HTTPBin"
    }
  ],
  "defaults": {
    "timeout": 10000,
    "method": "GET"
  }
}

Then just run:

api-health check

Options

| Flag | Description | Default | |------|-------------|---------| | -t, --timeout <ms> | Request timeout | 10000 | | -m, --method <method> | HTTP method | GET | | -H, --header <key:value> | Custom header (repeatable) | - | | -j, --json | JSON output | false | | -d, --detailed | Detailed report | false | | -c, --config <path> | Config file path | auto-detect | | --concurrency <n> | Max parallel requests | 5 | | --no-ssl | Skip SSL check | false |

Use Cases

  • Pre-deploy checks — Verify all your APIs are healthy before deploying
  • SSL monitoring — Get warned before certificates expire
  • CI/CD pipelines — Add health checks to your deployment pipeline
  • On-call dashboards — Quick terminal dashboard for incident response
  • Performance monitoring — Track response time trends

Programmatic API

import { checkEndpoint, checkMultipleEndpoints } from '@chengyixu/api-health';

const result = await checkEndpoint('https://api.example.com', {
  timeout: 5000,
  method: 'GET',
});

console.log(result.status);        // 200
console.log(result.responseTime);  // 142
console.log(result.ssl?.daysUntilExpiry); // 76

License

MIT