Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

http-status-catalog

npm install @ferrow/http-status-catalog

CI

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}`); // true

API

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

About

Complete HTTP status code reference with IANA registry data, lookup utilities, and category helpers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages