# better-promise-hash

> A better Promise hash function

Latest version **1.0.3** (published 2016-12-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install better-promise-hash
pnpm add better-promise-hash
yarn add better-promise-hash
bun add better-promise-hash
```

## 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.3 |
| Published | 2016-12-22 |
| First published | 2016-12-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Steve Horne |
| Maintainers | shhquiet |
| Keywords | promise, hash |

## Links

- npm: https://www.npmjs.com/package/better-promise-hash
- Repository: https://shhQuiet@github.com/shhQuiet/better-promise-hash
- Homepage: https://github.com/shhQuiet/better-promise-hash#readme
- Issues: https://github.com/shhQuiet/better-promise-hash/issues
- npm.io page: https://npm.io/package/better-promise-hash

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-12-22
- 1.0.2 — 2016-12-22
- 1.0.1 — 2016-12-21

## README

# better-promise-hash [![travis status](https://travis-ci.org/shhQuiet/better-promise-hash.svg?branch=master)](https://travis-ci.org/shhQuiet/better-promise-hash#)

A better implementation of a hash function for Promise.  Returns a promise that is fulfilled when all the given promises have been fulfilled.  Any rejection rejects the whole hash.

The object passed to `hash` will be returned with promises replaced with the promise result.  Any non-promise objects will simply remain in the result.

*Sometimes you feel like a nut, sometimes you don't*

This modules adds a `hash` function to `Promise`.  This allows you to do things like this:

    let object= {
      one: new Promise((resolve,reject) => {
          resolve('somePromiseValue');
        }),
      two: 'someOtherValue'
    };

    Promise.hash(object).then((result) => {
      console.log(result.one); // echos "somePromiseValue"
      console.log(result.two); // echos "someOtherValue"
    });


This is similar to RSVP.hash, which supports a mix of promises and non-promise objects.

Hope that helps!

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