Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seanghay/promisive
Recursive Promise.all that works on object and array
https://github.com/seanghay/promisive
promise
Last synced: about 1 month ago
JSON representation
Recursive Promise.all that works on object and array
- Host: GitHub
- URL: https://github.com/seanghay/promisive
- Owner: seanghay
- License: mit
- Created: 2022-08-22T06:56:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-22T08:51:32.000Z (over 2 years ago)
- Last Synced: 2024-11-06T18:56:42.824Z (about 2 months ago)
- Topics: promise
- Language: JavaScript
- Homepage:
- Size: 147 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Promisive
Recursive `Promise.all` that works on `object` and `array`
[![test](https://github.com/seanghay/promisive/actions/workflows/test.yml/badge.svg)](https://github.com/seanghay/promisive/actions/workflows/test.yml)
[![npm-publish](https://github.com/seanghay/promisive/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/seanghay/promisive/actions/workflows/npm-publish.yml)
[![npm](https://shields.io/npm/v/promisive)](https://npm.im/promisive)```js
import { promisive } from "promisive";await promisive({
a: {
b: [
Promise.resolve({
a: [{ a: Promise.resolve(1) }],
}),
Promise.resolve({
a: [{ a: Promise.resolve(2) }],
}),
],
},
});// this will resolve to
{
"a": {
"b": [
{
"a": [
{
"a": 1
}
]
},
{
"a": [
{
"a": 2
}
]
}
]
}
}
```### License
MIT