JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28189
  • Score
    100M100P100Q145256F
  • License MIT

An ES-spec-compliant shim/polyfill/replacement for the `.cause` property on all Error types that works as far down as ES3

Package Exports

  • error-cause
  • error-cause/package.json

Readme

error-cause Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES-spec-compliant shim/polyfill/replacement for the .cause property on all Error types that works as far down as ES3

This package implements the es-shim API “multi” interface. It works in an ES3-supported environment and complies with the proposed spec.

Getting started

npm install --save error-cause

Usage/Examples

const assert = require('assert');

require('error-cause/auto');

const e = new Error('message!', { cause: 'bugs' });

assert(e instanceof Error);
assert(e.cause === 'bugs');

Tests

Clone the repo, npm install, and run npm test