# @hazae41/future

> Just like a Promise but you can manually resolve or reject it

Latest version **2.0.1** (published 2025-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @hazae41/future
pnpm add @hazae41/future
yarn add @hazae41/future
bun add @hazae41/future
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-03-30 |
| First published | 2023-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | hazae41 |
| Maintainers | hazae41 |
| Keywords | future, promise, manual, fulfill, reject, async, signal, typescript, esmodules, tested, unit-tested |

## Links

- npm: https://www.npmjs.com/package/@hazae41/future
- Repository: https://github.com/hazae41/future
- Issues: https://github.com/hazae41/future/issues
- npm.io page: https://npm.io/package/@hazae41/future

## 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) — 2025-03-30
- 2.0.0 — 2025-03-30
- 1.0.3 — 2023-03-04
- 1.0.2 — 2023-03-04
- 1.0.1 — 2023-03-03
- 1.0.0 — 2023-03-02

## README

<div align="center">
<img src="https://user-images.githubusercontent.com/4405263/222497326-825b2ebb-910b-41ca-8759-785c4876faf0.png" />
</div>

Just like a Promise but you can manually resolve or reject it

```bash
npm i @hazae41/future
```

[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/future)

## Features

### Current features
- 100% TypeScript and ESM
- No external dependencies
- Unit-tested

## Usage

```typescript
import { Future } from "@hazae41/future"

const future = new Future<void>()

const t1 = setTimeout(() => future.resolve(), 1000)
const t2 = setTimeout(() => future.reject(), 2000)

try {
  await future.promise
} finally {
  clearTimeout(t1)
  clearTimeout(t2)
}
```

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