@eliware/errors is an ESM-only Node.js utility for registering process-level handlers for uncaught exceptions, unhandled rejections, and warnings.
- Use Node.js 26.
- Preserve both named and default
registerHandlersexports. - Keep registration idempotent per process-like object.
- Preserve existing process listeners.
- Keep cleanup safe and repeatable through
removeHandlers(). - Preserve support for custom loggers, process-like objects, selectable events, one-shot listeners, and
AbortSignalcleanup. - Never silently swallow handler or logger failures without documenting the behavior.
- Treat
uncaughtExceptionhandling carefully; applications should log the error and shut down gracefully when appropriate.
Run before committing:
npm test
npm run lint
npm run test:gapsMaintain 100% test coverage without Istanbul ignore directives. Add or update tests for every behavior change.
- Update
index.d.tswhenever the public API changes. - Update
README.mdandexample.mjsfor user-facing behavior. - Keep examples safe to run; do not intentionally terminate the developer's shell unless explicitly demonstrating that behavior.
- Do not bump versions, create release notes, tag, or publish unless explicitly requested.
- Keep
.agentx*, coverage output, and temporary test artifacts ignored. - Avoid unnecessary dependency changes.
- Do not push changes unless explicitly requested.