@ferrow/http-status-catalog
v1.0.0
Published
Complete HTTP status code reference with IANA registry data, lookup utilities, and category helpers
Maintainers
Readme
http-status-catalog
Complete HTTP status code reference with IANA registry data, lookup utilities, and category helpers.
Quick Start
import { lookup, isRetryable } from "http-status-catalog";
const status = lookup(429);
console.log(`${status.code} ${status.name}`); // 429 Too Many Requests
console.log(`Retryable: ${status.retryable}`); // trueAPI
lookup(code: number): StatusInfo | undefined
Get detailed information for a specific HTTP status code.
interface StatusInfo {
code: number;
name: string;
category: string;
description: string;
retryable: boolean;
cacheable: boolean;
rfc?: string;
}isClientError(code: number): boolean
Check if code is 4xx.
isServerError(code: number): boolean
Check if code is 5xx.
isRetryable(code: number): boolean
Check if the status code suggests a retryable error (408, 429, 500, 502, 503, 504, 507, 421, 425).
isCacheable(code: number): boolean
Check if the status code is cacheable by default.
getByCategory(category: string): StatusInfo[]
Get all codes in a category: informational, success, redirection, client-error, server-error.
getCategories(): string[]
Get all available category names.
getAll(): StatusInfo[]
Get all status codes, sorted by code.
Limits
- Static registry; no updates without new release
- Covers all IANA-assigned codes through RFC 8470
- No vendor-specific or non-standard codes
Part of the ferrow-toolkit collection · Sponsored by Ferrow
