Standard HTTP Error Class
JSON →The `standard-http-error` package provides a minimalist, extensible JavaScript error class (`HttpError`) specifically designed for representing HTTP status codes. It allows for easy detection of HTTP-related errors using `instanceof` checks within error handling middleware. Currently at version 2.0.1, the core library has not seen updates since 2017, suggesting it is effectively abandoned by its original author, though type definitions are community-maintained. It follows semantic versioning for its major versions. Its key differentiators include its small footprint, direct alignment with standard HTTP status codes (supporting both numeric codes and descriptive names like "NOT_FOUND"), and features for proper error serialization. It offers compatibility with frameworks like Express and Koa by providing non-enumerable aliases for `code` and `message` as `status`, `statusCode`, and `statusMessage` for consistent error object structures.
Traffic · last 30 days ↓71% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇪🇸 Spain · 🇩🇪 Germany · 🇫🇷 France