# @steeringwaves/sleep

> typescript github template

Latest version **0.1.0** (published 2023-10-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @steeringwaves/sleep
pnpm add @steeringwaves/sleep
yarn add @steeringwaves/sleep
bun add @steeringwaves/sleep
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2023-10-13 |
| First published | 2022-09-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 1 |
| Unpacked size | 125.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | steeringwaves |
| Maintainers | maxattax, 1800alex |

## Links

- npm: https://www.npmjs.com/package/@steeringwaves/sleep
- Repository: https://github.com/steeringwaves/js-sleep
- Issues: https://github.com/steeringwaves/js-sleep/issues
- npm.io page: https://npm.io/package/@steeringwaves/sleep

## Dependencies (1)

- [@steeringwaves/pinkypromise](https://npm.io/package/@steeringwaves/pinkypromise.md) ^0.2.0

## Recent versions

- 0.1.0 (latest) — 2023-10-13
- 0.0.6 — 2023-06-29
- 0.0.5 — 2023-04-12
- 0.0.4 — 2023-03-17
- 0.0.3 — 2022-10-07
- 0.0.2 — 2022-09-27
- 0.0.1 — 2022-09-27

## README

# @steeringwaves/sleep

![workflow](https://github.com/github/docs/actions/workflows/test.yml/badge.svg)

A typescript async sleep utility.

## Example

### Promises

```js
const Sleep = require("@steeringwaves/sleep").default;

Sleep(500).then(() => console.log("500ms sleep finished")); // sleep 500ms
await Sleep(1000); // sleep 1s
console.log("1s sleep finished");
```

### Using contexts

```js
const Context = require("@steeringwaves/context").default;
const Sleep = require("@steeringwaves/sleep").default;

const ctx = new Context();

Sleep(2000)
	.setContext(ctx)
	.onCancel(() => {
		console.log("sleep canceled");
	})
	.then(() => console.log("sleep completed"))
	.catch((e) => console.log(e));

ctx.Done();
```

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