assertion-error
npmv2.0.1TypeScriptError constructor for test and validation frameworks that implements standardized AssertionError specification.
Adopt with care
assertion-error is usable, with caveats. Last published 1057 days ago.
- AAdoption: grade A, Excellent.
89.6M downloads per week and 2 known dependents.
- DMaintenance: grade D, Poor — a real concern.
Last published 1057 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 5.7 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 2 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 assertion-error 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.
Compatibility
- Node.js
- node >=12
- Module format
- ESM + CommonJS
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the assertion-error README.
interface Result {
name: "AssertionError" | "AssertionResult";
ok: boolean;
toJSON(...args: unknown[]): Record<string, unknown>;
}assertion-error 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 |
|---|---|---|---|---|
| assertion-errorthis page | 89.6M | 2 | MIT | 2 years ago |
| @vitest/expect | 0 | 1 | MIT | 1 day ago |
| chai | 0 | 57 | MIT | 1 day ago |
| p-locate | 216.9M | 1 | MIT | 1 day ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
| is-plain-obj | 112.9M | 1 | MIT | 1 day ago |
Used by
Popular packages that depend on assertion-error.
Relationship graph
Dependencies (left) and dependents (right) of assertion-error.
Frequently installed together
An extremely fast JavaScript and CSS bundler and minifier.
An AST-based pattern checker for JavaScript.
Prettier is an opinionated code formatter
TypeScript definitions for deep-eql
Release history
No releases in the last two years, typically about 635 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.0.1latest | 2 years ago | 5.7 KB | MIT |
| 2.0.0 | 5 years ago | 5.6 KB | MIT |
| 1.1.0 | 8 years ago | — | MIT |
| 1.0.2 | 10 years ago | — | MIT |
| 1.0.1 | 11 years ago | — | MIT |
| 1.0.0 | 13 years ago | — | MIT |
| 0.1.0 | 13 years ago | — | MIT |
Overview
assertion-error is an npm package that error constructor for test and validation frameworks that implements standardized AssertionError specification. It is extremely widely used, with about 89.6M downloads per week and 2 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 error constructor for test and validation frameworks that implements standardized AssertionError specification and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (89.6M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Zero runtime dependencies — minimal footprint.
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Keywords
Frequently asked questions
Should I use assertion-error?
assertion-error is usable, with caveats. Last published 1057 days ago.
How do I install assertion-error?
Run `npm install assertion-error` to add assertion-error to your npm project.
What license is assertion-error released under?
assertion-error is distributed under the MIT license.
How popular is assertion-error?
assertion-error has approximately 89,591,846 downloads per week and 2 known dependent packages.
Is assertion-error still maintained?
The most recent release of assertion-error (v2.0.1) was published 2 years ago.
Does assertion-error run install scripts?
No. assertion-error does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.