Custom Error Instance

JSON →
library 2.1.2 ·javascript maintenance
verified May 27, 2026

The `custom-error-instance` library provides a robust mechanism for creating custom JavaScript error constructors that correctly resolve with `instanceof` checks, including support for inheritance hierarchies. It seamlessly integrates with Node.js's native `Error` implementation, allowing developers to extend and define distinct error types without directly modifying the global `Error` object. Key features include the ability to attach custom properties, control error output, and specify stack trace lengths, addressing common challenges when creating custom error classes. The package is currently at version 2.1.2 (as of late 2023) and appears to be in a maintenance phase, with updates occurring on an as-needed basis rather than a fixed release cadence. Its primary differentiator lies in ensuring reliable `instanceof` behavior for custom errors, which can be tricky to implement correctly when extending the native `Error` class manually.

total hits 22
actors 5 distinct systems
last hit 1d ago Bingbot
ByteDance
9
MetaBot
4
Script
1
Search engines
3
Humans
2

top countries 🇸🇬 Singapore · 🇺🇸 United States · 🇬🇧 United Kingdom · 🇨🇦 Canada · PT