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.
- Host: GitHub
- URL: https://github.com/deno-delay/delay
- Owner: deno-delay
- License: mit
- Created: 2020-10-06T09:38:50.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-09T03:21:18.000Z (over 5 years ago)
- Last Synced: 2025-11-09T23:28:20.376Z (8 months ago)
- Topics: delay, deno, denoland, typescript
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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 [](https://opensource.org/licenses/MIT)