http-errors
npmv2.0.1Create HTTP error objects
Safe to adopt
Yes — http-errors scores well across adoption, maintenance, weight, supply chain, and licensing. 149.4M downloads per week and 7 known dependents. Last published 293 days ago.
- AAdoption: grade A, Excellent.
149.4M downloads per week and 7 known dependents.
- BMaintenance: grade B, Good.
Last published 293 days ago.
- AWeight: grade A, Excellent.
Pulls in 5 transitive packages, about 70 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 4 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding http-errors to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
Every license you inherit by installing http-errors, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >= 0.8
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the http-errors README.
var createError = require('http-errors')
var express = require('express')
var app = express()
app.use(function (req, res, next) {
if (!req.user) return next(createError(401, 'Please login to view this page.'))
next()
})http-errors vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| http-errorsthis page | 149.4M | 7 | MIT | 9 months ago |
| content-type | 191.4M | 6 | MIT | 1 day ago |
| negotiator | 183.3M | 2 | MIT | 1 day ago |
| node-fetch | 172.9M | 9 | MIT | 1 day ago |
| undici | 158.5M | 15 | MIT | 1 day ago |
| axios | 106.5M | 4 | MIT | 1 day ago |
Dependencies
Declared by http-errors v2.0.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (9)
Used by
Popular packages that depend on http-errors.
Get and validate the raw body of a readable stream.
Better streaming static file server with Range and conditional-GET support
Node.js body parsing middleware
Fast, unopinionated, minimalist web framework
Fast and low overhead web framework, for Node.js
Koa web app framework
assert with status codes
Relationship graph
Dependencies (left) and dependents (right) of http-errors.
Frequently installed together
An AST-based pattern checker for JavaScript.
Manipulate the HTTP Vary header
TypeScript definitions for node
An HTTP/1.1 client, written from scratch for Node.js
Really Fast Deep Clone
The semantic version parser used by npm.
Asynchronous bootstrapping of Node applications
Build and manage the fast-json-stringify instances for the fastify framework
Crazy fast http radix based router
Stringify your JSON at max speed
A small utility for creating warnings and emitting them.
Fake HTTP injection library
Release history
1 release in the last two years, typically about 123 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.0.1latest | 9 months ago | 19 KB | MIT |
| 2.0.0 | 4 years ago | 18 KB | MIT |
| 1.8.1 | 4 years ago | 18 KB | MIT |
| 1.8.0 | 6 years ago | 18 KB | MIT |
| 1.7.3 | 7 years ago | 17 KB | MIT |
| 1.7.2 | 7 years ago | 17 KB | MIT |
| 1.7.1 | 8 years ago | 17 KB | MIT |
| 1.7.0 | 8 years ago | 17 KB | MIT |
| 1.6.3 | 8 years ago | 15 KB | MIT |
| 1.6.2 | 9 years ago | — | MIT |
| 1.6.1 | 9 years ago | — | MIT |
| 1.6.0 | 9 years ago | — | MIT |
| 1.5.1 | 9 years ago | — | MIT |
| 1.5.0 | 10 years ago | — | MIT |
| 1.4.0 | 10 years ago | — | MIT |
Overview
http-errors is an npm package that create HTTP error objects. It is extremely widely used, with about 149.4M downloads per week and 7 known dependents in the graph. The latest version is 2.0.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need create HTTP error objects and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (149.4M weekly downloads).
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use http-errors?
Yes — http-errors scores well across adoption, maintenance, weight, supply chain, and licensing. 149.4M downloads per week and 7 known dependents. Last published 293 days ago.
How do I install http-errors?
Run `npm install http-errors` to add http-errors to your npm project.
How many dependencies does http-errors have?
http-errors declares 14 direct dependencies and pulls in 5 packages in total once its runtime tree is resolved totalling about 70 KB on disk.
What license is http-errors released under?
http-errors is distributed under the MIT license. Its dependency tree also includes: ISC, MIT.
How popular is http-errors?
http-errors has approximately 149,403,825 downloads per week and 7 known dependent packages.
Is http-errors still maintained?
The most recent release of http-errors (v2.0.1) was published 9 months ago.
Does http-errors run install scripts?
No. http-errors does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.