{"library":"catch-unknown","type":"library","category":null,"description":"catch-unknown is a focused utility library designed to simplify the handling of `unknown` error types within JavaScript and TypeScript `catch` blocks. Following TypeScript 4.4's decision to default `catch` variables to `unknown`, developers are required to perform explicit type guarding or conversion. This library provides two primary functions: `isError`, which functions as a type guard to verify if a value conforms to the standard `Error` interface, and `asError`, which transforms any thrown value into an `Error`-like object, guaranteeing it possesses at least `name` and `message` properties. Currently at version `2.0.0`, the library emphasizes stability, minimal footprint, compiles to ES6 for broad compatibility, and has no runtime dependencies, ensuring a small package size and efficient error handling without introducing complex abstractions.","language":"javascript","status":"active","version":"2.0.0","tags":["javascript","base62","id","random","uuid","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install catch-unknown","imports":["import { asError } from 'catch-unknown';","import { isError } from 'catch-unknown';"]},{"cmd":"yarn add catch-unknown","imports":[]},{"cmd":"pnpm add catch-unknown","imports":[]}],"homepage":null,"github":"https://github.com/trevorr/catch-unknown","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/catch-unknown","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/catch-unknown/compatibility"}}