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

https://github.com/deno-delay/delay

The standard Deno module for delaying a specified amount of time.
https://github.com/deno-delay/delay

delay deno denoland typescript

Last synced: about 1 month ago
JSON representation

The standard Deno module for delaying a specified amount of time.

Awesome Lists containing this project

README

          

# delay

The standard Deno module for delaying a specified amount of time.

## 🔧 How to use

```js
import { delay } from 'https://deno.land/x/delay@v0.2.0/mod.ts';
```

## 💡 Usage

### 🎀 delay

```ts
import { delay } from 'https://deno.land/x/delay@v0.2.0/mod.ts';

(async () => {
console.log('Executed 100 milliseconds later');

await delay(100);

console.log('Hello World!');
})();
```

### 🎀 delay.reject

```ts
import { delay } from 'https://deno.land/x/delay@v0.2.0/mod.ts';

(async () => {
try {
await delay.reject(100, { value: new Error('Rejected') });

console.log('This is never executed');
} catch (error) {
// 100 milliseconds later
console.log(error);
//=> [Error: Rejected]
}
})();
```

## 📜 Changelog

Details changes for each release are documented in the [CHANGELOG.md](https://github.com/deno-delay/delay/blob/main/CHANGELOG.md).

## ❗ Issues

If you think any of the `delay` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.

## 💪 Contribution

We'd love to have your helping hand on contributions to `delay` by forking and sending a pull request!

Your contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)

How to contribute:

- Open pull request with improvements
- Discuss ideas in issues
- Spread the word
- Reach out with any feedback

## ⚖️ License

The MIT License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)