Node.js wrapper for HTTP status codes and error creation. Current stable version 0.2.0. Provides an object-oriented interface to access HTTP status codes by name (e.g., BAD_REQUEST, OK), each containing `code`, `message`, and a `createError()` method to generate Node.js Error instances that include the full status data. Lightweight alternative to packages like `http-status` or `http-status-codes`, with built-in error construction support.
npm install http-statusesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to require the package, access status codes by name, and use createError() in an Express route.
Use require() or dynamic import().
Access via HTTP_STATUSES.BAD_REQUEST, not HTTP_STATUSES['400'].
Use error.message or error.httpStatus.code; do not rely on instanceof.
Run npm install http-statuses
Use const HTTP_STATUSES = require('http-statuses');No dependency data recorded yet.