Skip to content
/ asde Public

Simple error handling with async await using destructuring

License

Notifications You must be signed in to change notification settings

gradeup/asde

Repository files navigation

asde Build Status codecov

Easy error handling with async await and destructuring for promises

Install

$ npm install @gradeup/asde

Usage

const asde = require('@gradeup/asde');
const promise = Promise.reject(new Error('Something went wrong'));
const fn = async () => await asde(p);
//=> [{ message: 'Something went wrong' }, null]

API

asde(input)

input

Type: Promise

Promise or any thenable to resolve

License

MIT © Nikhil Srivastava