http-assert
npmv1.5.0assert with status codes
Not recommended for new projects
No — http-assert should not be adopted for new projects. Last published 1842 days ago. Pulls in 57 transitive packages, about 939 KB installed (at least — some of the tree is still being crawled).
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 1842 days ago.
- CWeight: grade C, Fair — worth a look.
Pulls in 57 transitive packages, about 939 KB installed (at least — some of the tree is still being crawled).
- ASupply chain: grade A, Excellent.
No install scripts, 3 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-assert 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.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Licenses in the dependency tree
Every license you inherit by installing http-assert, 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-assert README.
var assert = require('http-assert')
var ok = require('assert')
var username = 'foobar' // username from request
try {
assert(username === 'fjodor', 401, 'authentication failed')
} catch (err) {
ok(err.status === 401)
ok(err.message === 'authentication failed')
ok(err.expose)
}http-assert 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-assertthis page | 0 | 1 | MIT | 5 years 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 |
| http-errors | 149.4M | 7 | MIT | 1 day ago |
Dependencies
Declared by http-assert v1.5.0. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (2)
Dev (9)
Used by
Popular packages that depend on http-assert.
Relationship graph
Dependencies (left) and dependents (right) of http-assert.
Frequently installed together
Create and parse HTTP Content-Type header
The ultimate javascript content-type utility.
Create HTTP error objects
Encode a URL to a percent-encoded form, excluding already-encoded sequences
Infer the content-type of a request.
Manipulate the HTTP Vary header
Execute a callback when a request closes, finishes, or errors
compose Koa middleware
Create and parse Content-Disposition header
delegate methods and accessors to another property
HTTP response freshness testing
Higher-level content negotiation
Release history
No releases in the last two years, typically about 231 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.5.0latest | 5 years ago | 8.9 KB | MIT |
| 1.4.1 | 7 years ago | 8.5 KB | MIT |
| 1.4.0 | 8 years ago | 8.5 KB | MIT |
| 1.3.0 | 9 years ago | — | MIT |
| 1.2.0 | 10 years ago | — | MIT |
| 1.1.1 | 11 years ago | — | MIT |
| 1.1.0 | 11 years ago | — | MIT |
| 1.0.2 | 12 years ago | — | MIT |
| 1.0.1 | 12 years ago | — | MIT |
| 1.0.0 | 12 years ago | — | MIT |
| 0.1.1 | 12 years ago | — | MIT |
| 0.1.0 | 12 years ago | — | MIT |
| 0.0.1 | 12 years ago | — | MIT |
Overview
http-assert is an npm package that assert with status codes. It has 1 known dependents in the graph. The latest version is 1.5.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need assert with status codes and value a focused 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
- 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
Frequently asked questions
Should I use http-assert?
No — http-assert should not be adopted for new projects. Last published 1842 days ago. Pulls in 57 transitive packages, about 939 KB installed (at least — some of the tree is still being crawled).
How do I install http-assert?
Run `npm install http-assert` to add http-assert to your npm project.
How many dependencies does http-assert have?
http-assert declares 11 direct dependencies and pulls in 57 packages in total once its runtime tree is resolved totalling about 939 KB on disk.
What license is http-assert released under?
http-assert is distributed under the MIT license. Its dependency tree also includes: ISC, MIT.
How popular is http-assert?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on http-assert.
Is http-assert still maintained?
The most recent release of http-assert (v1.5.0) was published 5 years ago.
Does http-assert run install scripts?
No. http-assert does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.