Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/117/sleep

A promise-based sleep function for Deno.
https://github.com/117/sleep

async await promise sleep

Last synced: 21 days ago
JSON representation

A promise-based sleep function for Deno.

Awesome Lists containing this project

README

        

# sleep

![version](https://img.shields.io/jsr/v/%40117/sleep?style=flat-square&color=%23ff51bc&label=version)
![status](https://img.shields.io/github/actions/workflow/status/117/sleep/deploy.yml?style=flat-square)

A promise-based sleep function for Deno.

## Contents

- [Features](#features)
- [Install](#install)
- [Example](#example)
- [Contributing](#contributing)

## Features

- [x] Minimal and easy to use.
- [x] Can be used to `await` for a specified amount of time.

## Install

For Deno:

```sh
$ deno add @117/sleep
```

## Example

```ts
import { sleep } from "@117/sleep";

const work = async () => {
console.log("please wait for 2 seconds");
await sleep(2000);
console.log("thanks for waiting");
};

work();
```

## Contributing

Feel free to contribute and PR to your 💖's content.