</>PackageGraphPackageGraph

assertion-error

npmv2.0.1TypeScript

Error 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

5.7 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

typescriptFull 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.

PackageWeekly downloadsDependentsLicenseLast release
assertion-errorthis page89.6M2MIT2 years ago
@vitest/expect01MIT1 day ago
chai057MIT1 day ago
p-locate216.9M1MIT1 day ago
is-glob137.4M3MIT1 day ago
is-plain-obj112.9M1MIT1 day ago

Used by

Popular packages that depend on assertion-error.

Relationship graph

Dependencies (left) and dependents (right) of assertion-error.

chai@types/chaiassertion-error
assertion-error dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 635 days apart.

Recent versions of assertion-error
VersionPublishedSizeLicense
2.0.1latest2 years ago5.7 KBMIT
2.0.05 years ago5.6 KBMIT
1.1.08 years agoMIT
1.0.210 years agoMIT
1.0.111 years agoMIT
1.0.013 years agoMIT
0.1.013 years agoMIT

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.

Maintainers

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.