dom-exception-modern

JSON →
library 0.1.0 ·javascript
verified Jun 7, 2026

A zero-dependency migration helper for replacing the deprecated `domexception` package with the native `DOMException` constructor available in modern Node.js (>=18), browsers, and Deno. Version 0.1.0 released in 2025. It default-exports the native DOMException for drop-in compatibility, and provides typed utility functions: `createDOMException`, `isDOMException`, `toDOMException`, and legacy code constants via `domExceptionCodes`. Ships TypeScript declarations. Unlike the legacy `domexception`, this package has no runtime fallback and is intended only for environments where DOMException is natively available.