Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dwqs/async-await-error-handling
Error handling friendly for async/await in ts and js
https://github.com/dwqs/async-await-error-handling
async await error-handling
Last synced: 19 days ago
JSON representation
Error handling friendly for async/await in ts and js
- Host: GitHub
- URL: https://github.com/dwqs/async-await-error-handling
- Owner: dwqs
- License: mit
- Created: 2017-07-11T06:42:26.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-23T13:14:38.000Z (over 7 years ago)
- Last Synced: 2024-10-13T14:15:48.015Z (about 1 month ago)
- Topics: async, await, error-handling
- Language: JavaScript
- Homepage:
- Size: 44.9 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![build pass](https://api.travis-ci.org/dwqs/async-await-error-handling.svg?branch=master)](https://travis-ci.org/dwqs/async-await-error-handling) ![npm-version](https://img.shields.io/npm/v/async-await-error-handling.svg) ![license](https://img.shields.io/npm/l/async-await-error-handling.svg) ![bower-license](https://img.shields.io/bower/l/async-await-error-handling.svg)
# async-await-error-handlingError 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