await-to-done
Advanced tools
Comparing version 1.1.0 to 1.1.1
/*! | ||
* await-to-done v1.1.0 | ||
* await-to-done v1.1.1 | ||
* Async await wrapper for easy error handling | ||
@@ -4,0 +4,0 @@ * (c) 2021-2024 saqqdy |
/*! | ||
* await-to-done v1.1.0 | ||
* await-to-done v1.1.1 | ||
* Async await wrapper for easy error handling | ||
@@ -4,0 +4,0 @@ * (c) 2021-2024 saqqdy |
/*! | ||
* await-to-done v1.1.0 | ||
* await-to-done v1.1.1 | ||
* Async await wrapper for easy error handling | ||
@@ -4,0 +4,0 @@ * (c) 2021-2024 saqqdy |
/*! | ||
* await-to-done v1.1.0 | ||
* await-to-done v1.1.1 | ||
* Async await wrapper for easy error handling | ||
@@ -4,0 +4,0 @@ * (c) 2021-2024 saqqdy |
{ | ||
"name": "await-to-done", | ||
"description": "Async await wrapper for easy error handling", | ||
"version": "1.1.0", | ||
"packageManager": "pnpm@8.9.0", | ||
"version": "1.1.1", | ||
"packageManager": "pnpm@9.1.3", | ||
"main": "dist/index.cjs.js", | ||
@@ -7,0 +7,0 @@ "module": "dist/index.esm-bundler.js", |
@@ -39,5 +39,7 @@ <div style="text-align: center;" align="center"> | ||
### ES6 module | ||
### Simple Usage | ||
```js | ||
1. ES6 module | ||
```ts | ||
import to from 'await-to-done' | ||
@@ -48,5 +50,5 @@ | ||
### Node.js require | ||
2. Node.js require | ||
```js | ||
```ts | ||
const to = require('await-to-done') | ||
@@ -57,2 +59,15 @@ | ||
### Multiple Promises | ||
```ts | ||
import to from 'await-to-done' | ||
const bar = () => new Promise<boolean>() | ||
const foo = () => new Promise<string>() | ||
const [err, data] = await to(bar(), foo()) // data = [boolean, string] | ||
// or pass in an Array | ||
const [err, data] = await to([bar(), foo()]) // data = [boolean, string] | ||
``` | ||
### Using unpkg CDN | ||
@@ -59,0 +74,0 @@ |
15115
105