Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/117/sleep
- Owner: 117
- License: mit
- Created: 2024-08-11T05:42:47.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T05:42:48.000Z (5 months ago)
- Last Synced: 2024-11-30T14:49:14.764Z (25 days ago)
- Topics: async, await, promise, sleep
- Language: TypeScript
- Homepage: https://jsr.io/@117/sleep
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.