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.
npm install dom-exception-modernNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows default and named imports, constructor usage, utility helpers, and legacy code constants.
Ensure runtime supports DOMException natively. Use polyfill or stick with legacy 'domexception' for Node <18.
Replace `import DOMException from 'dom-exception-modern'` with `const DOMException = globalThis.DOMException` or just use `DOMException` directly.
Always use `new DOMException(...)` to create instances.
Rely on error `name` instead of `code` for cross-platform compatibility.
Use `import DOMException from 'dom-exception-modern'` (default import) instead of `import { DOMException } from 'dom-exception-modern'`.Upgrade Node to >=18 or use a polyfill like `domexception` package.
Use `new DOMException(...)` to instantiate.
No dependency data recorded yet.