{"library":"await-to-js","type":"library","category":null,"description":"await-to-js is a lightweight zero-dependency utility that wraps a Promise and returns an array with either an error or the resolved value, enabling a Go-like error handling pattern in async/await functions. The current stable version is 3.0.0, with a stable release cadence. It ships TypeScript definitions. Differentiators: extremely simple API, tree-shakable, no external dependencies. It is commonly used in Node.js and browser environments to avoid try-catch blocks and improve code readability when handling promise rejections.","language":"javascript","status":"active","version":"3.0.0","tags":["javascript","node","async","await","async await","typescript"],"last_verified":"Fri May 01","install":[{"cmd":"npm install await-to-js","imports":["import to from 'await-to-js'","import to from 'await-to-js'","import to from 'await-to-js'; const [err, data] = await to<{test: number}>(promise);"]},{"cmd":"yarn add await-to-js","imports":[]},{"cmd":"pnpm add await-to-js","imports":[]}],"homepage":null,"github":"https://github.com/scopsy/await-to-js","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/await-to-js","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}