It converts any throwable into an Error.
- node: 18
 
Through NPM as @chubbyts/chubbyts-throwable-to-error.
npm i @chubbyts/chubbyts-throwable-to-error@^2.0.2import { throwableToError } from '@chubbyts/chubbyts-throwable-to-error/dist/throwable-to-error';
try {
   throw {key: 'value'};
} catch (e) {
  const error = throwableToError(e);
}2025 Dominik Zogg