# nanodelay

> A tiny (25 bytes) Promise wrapper around setTimeout

Latest version **2.0.2** (published 2021-10-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-10-17 |
| First published | 2017-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^12.0.0 \|\| ^14.0.0 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 199 |
| Author | Andrey Sitnik |
| Maintainers | ai |
| Keywords | promise, delay, settimeout, setTimeout, wait, async, await, esm |

## Links

- npm: https://www.npmjs.com/package/nanodelay
- Repository: https://github.com/ai/nanodelay
- Homepage: https://github.com/ai/nanodelay#readme
- Issues: https://github.com/ai/nanodelay/issues
- npm.io page: https://npm.io/package/nanodelay

## 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.2 (latest) — 2021-10-17
- 2.0.1 — 2021-09-04
- 2.0.0 — 2021-04-23
- 1.0.8 — 2021-03-15
- 1.0.7 — 2021-03-11
- 1.0.6 — 2020-10-23
- 1.0.5 — 2020-10-23
- 1.0.4 — 2020-10-20
- 1.0.3 — 2020-06-13
- 1.0.2 — 2020-05-11
- 1.0.1 — 2020-03-08
- 1.0.0 — 2020-03-07
- 0.1.4 — 2018-07-18
- 0.1.3 — 2017-12-08
- 0.1.2 — 2017-10-22
- … 2 more at https://npm.io/package/nanodelay/versions

## README

# Nano Delay

A tiny `Promise` wrapper around `setTimeout` for JavaScript.
Returns a `Promise` and resolve it after a specific amount of time.

* Only **40 bytes** (minified and gzipped),
  10 times smaller than [`delay`] library.
* Has good **ES modules** and **TypeScript** support.

```js
import { delay } from 'nanodelay'

async function foo () {
  await delay(300)
  // Executed after 300 milliseconds
}

delay(300).then(() => {
  // Executed after 300 milliseconds
})
```

[`delay`]: https://github.com/sindresorhus/delay

<a href="https://evilmartians.com/?utm_source=nanodelay">
  <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
       alt="Sponsored by Evil Martians" width="236" height="54">
</a>


## Docs
Read **[full docs](https://github.com/ai/nanodelay#readme)** on GitHub.

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