domexception (2.0.1)

Published 2026-02-24 13:55:39 +00:00 by atheaadmin

Installation

registry=
npm install domexception@2.0.1
"domexception": "2.0.1"

About this package

DOMException

This package implements the DOMException class, from web browsers. It exists in service of jsdom and related packages.

Example usage:

const DOMException = require("domexception");

const e1 = new DOMException("Something went wrong", "BadThingsError");
console.assert(e1.name === "BadThingsError");
console.assert(e1.code === 0);

const e2 = new DOMException("Another exciting error message", "NoModificationAllowedError");
console.assert(e2.name === "NoModificationAllowedError");
console.assert(e2.code === 7);

console.assert(DOMException.INUSE_ATTRIBUTE_ERR === 10);

APIs

This package exposes two flavors of the DOMException interface depending on the imported module.

domexception module

This module default-exports the DOMException interface constructor.

domexception/webidl2js-wrapper module

This module exports the DOMException interface wrapper API generated by webidl2js.

Dependencies

Dependencies

ID Version
webidl-conversions ^5.0.0

Development Dependencies

ID Version
eslint ^6.7.2
mkdirp ^0.5.1
mocha ^6.2.2
request ^2.88.0
webidl2js ^12.0.0

Keywords

dom webidl web idl domexception error exception
Details
npm
2026-02-24 13:55:39 +00:00
0
Domenic Denicola
MIT
latest
4.7 KiB
Assets (1)
Versions (1) View all
2.0.1 2026-02-24