{"library":"throw-http-errors","type":"library","category":null,"description":"throw-http-errors is a JavaScript/TypeScript library designed to streamline the creation and handling of HTTP status code-specific errors. Currently at version 4.0.1, the library provides a comprehensive set of custom error classes corresponding to most standard HTTP status codes, from client errors like `BadRequest` (400) and `Unauthorized` (401) to server errors such as `InternalServerError` (500) and `ServiceUnavailable` (503). It allows developers to instantiate these errors either by their descriptive named class (e.g., `new errors.NotFound('User not found')`) or by their numeric status code (e.g., `new errors[404]('Resource missing')`), along with optional custom messages and internal error codes, providing flexibility for different error reporting needs. The library also includes a `CreateCustomError` utility for defining unique application-specific HTTP errors. This package differentiates itself by offering a structured, type-safe approach to HTTP error propagation in modern Node.js and browser environments, shipping with full TypeScript definitions to enhance developer experience and reduce runtime errors. While a previous JavaScript-only version exists on a separate branch (pre-v4), the current major version prioritizes TypeScript and ESM, ensuring a modern and robust error handling mechanism for web applications and APIs. The project maintains a steady release cadence, with major versions typically indicating significant architectural or language-level shifts.","language":"javascript","status":"active","version":"4.0.1","tags":["javascript","throw","errors","throw errors","http errors","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install throw-http-errors","imports":["import { BadRequest } from 'throw-http-errors';","import * as errors from 'throw-http-errors';","const errors = require('throw-http-errors');"]},{"cmd":"yarn add throw-http-errors","imports":[]},{"cmd":"pnpm add throw-http-errors","imports":[]}],"homepage":null,"github":"https://github.com/eldimious/throw-error","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/throw-http-errors","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/throw-http-errors/compatibility"}}