Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neosiae/await-to-all
Promise.all wrapper for easier error handling when using async/await
https://github.com/neosiae/await-to-all
Last synced: 24 days ago
JSON representation
Promise.all wrapper for easier error handling when using async/await
- Host: GitHub
- URL: https://github.com/neosiae/await-to-all
- Owner: neosiae
- License: mit
- Created: 2019-05-22T16:20:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-10T13:07:07.000Z (over 2 years ago)
- Last Synced: 2024-10-02T09:13:24.148Z (about 1 month ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# await-to-all
![npm](https://img.shields.io/npm/v/await-to-all.svg?style=flat-square) ![Travis (.com) branch](https://img.shields.io/travis/com/neosiae/await-to-all/master.svg?style=flat-square) ![npm](https://img.shields.io/npm/dw/await-to-all.svg?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/min/await-to-all.svg?style=flat-square) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
Promise.all wrapper for easier error handling when using async/await
## Install
> \$ npm install await-to-all
## Usage
```javascript
const toAll = require('await-to-all')async function someAsyncFunction() {
const [error, data] = await toAll([Promise, Promise, Promise])if (error) {
console.error(error)
}console.log(data)
}
```## See Also
[await-to-js](https://github.com/scopsy/await-to-js)
## License
MIT