# future-event

> A simple, tiny utility class for promising a future event will occur, allowing you to `await` it. For instance:

Latest version **1.6.0** (published 2020-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install future-event
pnpm add future-event
yarn add future-event
bun add future-event
```

## 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.6.0 |
| Published | 2020-07-26 |
| First published | 2020-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Christian Lewis |
| Maintainers | telework |
| Keywords | promise, await, async, event |

## Links

- npm: https://www.npmjs.com/package/future-event
- npm.io page: https://npm.io/package/future-event

## 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

- 1.6.0 (latest) — 2020-07-26
- 1.5.0 — 2020-07-26
- 1.1.0 — 2020-07-26
- 1.0.0 — 2020-07-26

## README

# FutureEvent
A simple, tiny utility class for promising a future event will occur, allowing you to
`await` it. For instance:

```javascript
async function test() {
  /** Promise an event will happen eventually. */
  const inFiveSeconds = new FutureEvent();

  /** Fire FutureEvent.ready() after 5s. */
  setTimeout(() => inFiveSeconds.ready(), 5e3);
  
  console.log('⏱️  Waiting for event...');
  await inFiveSeconds;
  console.log('✅  Done!');
}

test();
```

Will print `⏱️  Waiting for event...`, wait 5 seconds until the event fires
(non-blocking), and then print `✅  Done!`  (Run yourself with `node example/` 
in the root directory.)

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