0.1.0 • Published 1 year ago
@kearash/safe v0.1.0

Handle your await/async promises safely without try/catch blocks.
Installation
npm i @kearash/safepnpm add @kearash/safebun i @kearash/safeyarn add @kearash/safeUsage
import { safe } from '@kearash/safe';
const fetchData = async () => {
const [error, data] = await safeAwait(fetch('https://jsonplaceholder.typicode.com/'));
if (error) {
console.error('Error fetching data:', error);
return;
}
console.log('Fetched data:', data);
};
fetchData();License
This project is licensed under the MIT License. See the LICENSE file for details.
0.1.0
1 year ago