Skip to content
harshitgupta31415Public

About

Zero-dependency CLI for checking API availability, latency targets, and status contracts.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

API Pulse

API Pulse is a zero-dependency command-line health checker for small services, demos, and CI environments. Define the endpoint contract once, then get a readable availability and latency report with a useful exit code.

Configure

Create pulse.config.json:

{
  "endpoints": [
    {
      "name": "Public API",
      "url": "https://api.example.com/health",
      "expectedStatus": 200,
      "timeoutMs": 5000,
      "maxLatencyMs": 800
    }
  ]
}

expectedStatus accepts one code or an array. Without it, any response from 200 through 399 is accepted.

Run

npm link
api-pulse
api-pulse --config examples/pulse.config.json
api-pulse --json --output report.json
api-pulse --strict-latency

An unreachable endpoint or unexpected HTTP status returns exit code 1. Degraded latency is informational unless --strict-latency is enabled. Invalid configuration returns 2.

Why use it?

  • Multiple checks run concurrently while output retains configuration order.
  • Per-endpoint timeout, latency target, method, and accepted statuses are explicit.
  • Reports never include response bodies, tokens, or headers.
  • JSON output can feed CI artifacts or a lightweight status dashboard.
  • Runtime code uses only APIs included with Node.js 20 and newer.

Development

npm test
npm run check

The test suite injects fake network responses and does not rely on public endpoint availability.

Licence

MIT

About

Zero-dependency CLI for checking API availability, latency targets, and status contracts.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages