
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
A simple cache for a few of the JS Error constructors.
const assert = require('assert');
const Base = require('es-errors');
const Eval = require('es-errors/eval');
const Range = require('es-errors/range');
const Ref = require('es-errors/ref');
const Syntax = require('es-errors/syntax');
const Type = require('es-errors/type');
const URI = require('es-errors/uri');
assert.equal(Base, Error);
assert.equal(Eval, EvalError);
assert.equal(Range, RangeError);
assert.equal(Ref, ReferenceError);
assert.equal(Syntax, SyntaxError);
assert.equal(Type, TypeError);
assert.equal(URI, URIError);
Simply clone the repo, npm install, and run npm test
Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.
The custom-error-generator package provides similar functionality for creating custom error types. It allows for defining error classes with additional properties and methods. Compared to es-errors, it offers more flexibility in defining the structure of the error objects.
The extendable-error-class package is another alternative for creating custom error classes. It focuses on providing a simple base class that can be extended to create custom errors. While es-errors provides a utility function for error creation, extendable-error-class relies on traditional class inheritance.
The verror package is designed for creating and managing nested errors with additional context. It is more focused on error wrapping and providing detailed error information, which is different from the primary focus of es-errors on custom error type creation.
FAQs
A simple cache for a few of the JS Error constructors.
The npm package es-errors receives a total of 61,073,999 weekly downloads. As such, es-errors popularity was classified as popular.
We found that es-errors demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies