Skip to content

masstensor/httpstat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

httpstat

DevTools API

Visualize HTTP request timing in your terminal.

TypeScript | Zero dependencies | CLI + API

License: MIT

Features

  • Beautiful terminal timing breakdown (DNS, TCP, TLS, Server, Transfer)
  • Color-coded bar chart visualization
  • JSON output for scripting (--json)
  • Show response headers (-I) and body (-b)
  • Custom HTTP methods, headers, and request body
  • Automatic HTTPS upgrade
  • Follow redirects (configurable)
  • Programmatic API for Node.js
  • Zero runtime dependencies

Quick Start

npm install && npm run build
node dist/cli.js https://example.com

Output

  HTTP/GET https://example.com
  200 OK  |  93.184.216.34  |  1.2KB body

  ┌─ Timing Breakdown ─────────────────────────────────┐
  │
  │  DNS Lookup              15ms  ██
  │  TCP Connection          25ms  ███
  │  TLS Handshake           45ms  █████
  │  Server Processing       80ms  █████████
  │  Content Transfer        10ms  █
  │
  │  Total                  175ms
  └────────────────────────────────────────────────────┘

CLI Usage

# Basic timing
httpstat https://example.com

# POST with JSON body
httpstat -X POST -H "Content-Type: application/json" -d '{"key":"val"}' https://api.example.com

# Show headers
httpstat -I https://example.com

# JSON output (pipe to jq)
httpstat --json https://example.com | jq .timing

# Show response body
httpstat -b https://example.com

Options

Flag Description
-X, --method <M> HTTP method (default: GET)
-H, --header <H> Add request header
-d, --data <body> Request body
-I, --headers Show response headers
-b, --body Show response body
--json Output as JSON
-h, --help Show help

API

import { makeRequest, formatTimingDisplay } from 'httpstat-cli';

const result = await makeRequest('https://example.com');
console.log(formatTimingDisplay(result));
console.log(`Total: ${result.timing.total}ms`);

License

MIT

About

Visualize HTTP request timing in your terminal

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors