# promise-share

> Creates a getter function for a promise result

Latest version **2.0.1** (published 2026-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-share
pnpm add promise-share
yarn add promise-share
bun add promise-share
```

## Health

**Score 55/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-06-01 |
| First published | 2019-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22.13 |
| Dependencies | 1 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 104 |
| Author | Zoltan Kochan |
| Maintainers | zkochan |
| Keywords | promise |

## Links

- npm: https://www.npmjs.com/package/promise-share
- Repository: https://github.com/zkochan/packages/tree/main/promise-share
- Homepage: https://github.com/zkochan/packages/tree/main/promise-share#readme
- npm.io page: https://npm.io/package/promise-share

## Dependencies (1)

- [p-reflect](https://npm.io/package/p-reflect.md) ^3.1.0

## Alternatives

- [@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
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-06-01
- 2.0.0 — 2026-03-11
- 1.0.0 — 2019-09-13

## README

# promise-share

> Creates a getter function for a promise result

<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/promise-share.svg)](https://www.npmjs.com/package/promise-share)
<!--/@-->

Helps to avoid *UnhandledPromiseRejectionWarning*.
If you need to export a result as a promise, use this function to wrap the promise.
When you'll need the result of the promise, run the function.

## Installation

```sh
<pnpm|yarn|npm> add promise-share
```

## Usage

```js
'use strict'
const promiseShare = require('promise-share')

const file = promiseShare(readFileAsync())

console.log(await file())
//> file content
```

## License

[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io)

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