attempt-in-js
v1.0.2
Published
simplified error management for operations.
Readme
Node Attempt
Simplified promise error management and handling.
Install
npm i attempt-in-jsUsage
import { attempt } from 'attempt-in-js'
const [error, result] = await attempt(async () => await fetchData());
if (error) {
console.error("Operation failed:", error);
} else {
console.log("Operation succeeded:", result);
}Local
git clone https://github.com/simon-fraser/attempt-in-js.git
cd Attempt
npm installYou can build and test locally via
# Build
npm run build# Test
npm run testLicense
This project is licensed under the MIT License.
