safe-async-ts
v1.0.0
Published
A minimal TypeScript utility for safe asynchronous operations using tuple destructuring. Avoid try/catch blocks and handle async errors cleanly with [error, result] syntax. Lightweight, tree-shakable, and designed for developer productivity in modern Type
Maintainers
Readme
safe-async-ts
A tiny utility to safely handle asynchronous calls in TypeScript using tuple destructuring — without try/catch everywhere.
Install
npm install safe-async-tsUsage
import { safeAsync } from 'safe-async-ts';
const [err, data] = await safeAsync(apiCall());
if (err) {
// handle error
} else {
// use data
}📄 License
MIT © Sanjib Kumar Mandal
