# promison

> await json promise data

Latest version **1.0.7** (published 2019-10-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install promison
pnpm add promison
yarn add promison
bun add promison
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-10-26 |
| First published | 2019-09-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | xusd320 |
| Maintainers | xusd320 |
| Keywords | promise, trick, async |

## Links

- npm: https://www.npmjs.com/package/promison
- Repository: https://github.com/xusd320/awaitJson
- Homepage: https://github.com/xusd320/awaitJson#readme
- Issues: https://github.com/xusd320/awaitJson/issues
- npm.io page: https://npm.io/package/promison

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2019-10-26
- 1.0.6 — 2019-09-29
- 1.0.5 — 2019-09-26
- 1.0.4 — 2019-09-26
- 1.0.3 — 2019-09-26
- 1.0.2 — 2019-09-26
- 1.0.1 — 2019-09-26
- 1.0.0 — 2019-09-26

## README

Expect to generate data from asynchronous apis like blow:

```js
async function get() {
  const result = {
    v1: await Promise.resolve('v1'),
    v2: { value: await Promise.resolve('v2') },
    v3: { v3: [ 1, 2, 3 ].map(i => await Promise.resolve(i))},
  };

  return result;
}
```
In these codes, these promises will be executed one by one, not in a concurrent way.But if you use Promise.all, the code will be much more complicated because you hava to deal with the Promise.all's result array. Then let's try promison:

```js
const promison = require('promison');
async function get() {
  const data = {
    v1: Promise.resolve('v1'),
    v2: Promise.resolve({value: 'v2'}),
    v3: { arr: [ 1, 2, 3 ].map(i => Promise.resolve(i))},
  };

  const result =  await promison(data);
  return result;
}
```
It's easy to use and the procedure will be much more clear.

---
_Source: https://npm.io/package/promison · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
