async-await-error-handling
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

async-await-error-handling

build pass

Error handling friendly for async/await in ts and js.

Installation

Install the pkg with npm:

npm install async-await-error-handling --save

or yarn

yarn add async-await-error-handling

or bower

bower install async-await-error-handling

Usage

import awaitTo from 'async-await-error-handling';

async getData() {
    const [err, data] = await awaitTo(fetch('./data/person2.json'));
    
    if(err){
        throw err;
    }

    return data;
}

LICENSE

MIT

Package Sidebar

Install

npm i async-await-error-handling

Weekly Downloads

52

Version

0.5.2

License

MIT

Last publish

Collaborators

  • dwqs