Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inker/delay.js
⌛ Promisified setTimeout
https://github.com/inker/delay.js
async delay javascript promise sleep
Last synced: about 21 hours ago
JSON representation
⌛ Promisified setTimeout
- Host: GitHub
- URL: https://github.com/inker/delay.js
- Owner: inker
- Created: 2017-09-22T16:24:08.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-17T19:25:15.000Z (7 months ago)
- Last Synced: 2024-12-30T19:39:51.616Z (24 days ago)
- Topics: async, delay, javascript, promise, sleep
- Language: TypeScript
- Homepage:
- Size: 337 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# delay.js
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]
Promisified `setTimeout`.
## Installation
```
npm install --save delay.js
```## Usage
Basic usage:
```javascript
import delay from 'delay.js'async function foo() {
// ... do something
await delay(1000) // sleep 1 second
// ... continue
}
```[npm-url]: https://npmjs.org/package/delay.js
[downloads-image]: http://img.shields.io/npm/dm/delay.js.svg
[npm-image]: http://img.shields.io/npm/v/delay.js.svg
[david-dm-url]:https://david-dm.org/inker/delay.js
[david-dm-image]:https://david-dm.org/inker/delay.js.svg
[david-dm-dev-url]:https://david-dm.org/inker/delay.js#info=devDependencies
[david-dm-dev-image]:https://david-dm.org/inker/delay.js/dev-status.svg