2018-07-06 14:20:56 +02:00
|
|
|
# @pushrocks/smartdelay
|
|
|
|
|
2017-01-15 22:56:29 +01:00
|
|
|
timeouts for the async/await era, written in TypeScript
|
|
|
|
|
|
|
|
## Availabililty
|
2018-07-06 14:20:56 +02:00
|
|
|
|
2017-01-15 22:56:29 +01:00
|
|
|
[](https://www.npmjs.com/package/smartdelay)
|
|
|
|
[](https://GitLab.com/pushrocks/smartdelay)
|
|
|
|
[](https://github.com/pushrocks/smartdelay)
|
|
|
|
[](https://pushrocks.gitlab.io/smartdelay/)
|
|
|
|
|
|
|
|
## Status for master
|
2018-07-06 14:20:56 +02:00
|
|
|
|
2017-01-15 22:56:29 +01:00
|
|
|
[](https://GitLab.com/pushrocks/smartdelay/commits/master)
|
|
|
|
[](https://GitLab.com/pushrocks/smartdelay/commits/master)
|
|
|
|
[](https://www.npmjs.com/package/smartdelay)
|
|
|
|
[](https://david-dm.org/pushrocks/smartdelay)
|
|
|
|
[](https://www.bithound.io/github/pushrocks/smartdelay/master/dependencies/npm)
|
|
|
|
[](https://www.bithound.io/github/pushrocks/smartdelay)
|
|
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
|
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
|
|
[](http://standardjs.com/)
|
|
|
|
|
|
|
|
## Usage
|
2018-07-06 14:20:56 +02:00
|
|
|
|
2017-01-15 22:56:29 +01:00
|
|
|
Use TypeScript for best in class instellisense.
|
|
|
|
|
2017-01-16 14:54:08 +01:00
|
|
|
```javascript
|
2018-07-06 14:20:56 +02:00
|
|
|
import * as smartdelay from 'smartdelay';
|
2017-01-16 14:54:08 +01:00
|
|
|
|
|
|
|
(async () => {
|
2018-07-06 14:20:56 +02:00
|
|
|
await smartdelay.delayFor('3000'); // excution will halt here 3 seconds for this function scope BUT NOT BLOCK anything else
|
|
|
|
console.log();
|
|
|
|
})();
|
2017-01-16 14:54:08 +01:00
|
|
|
```
|
|
|
|
|
2017-01-15 22:56:29 +01:00
|
|
|
[](https://push.rocks)
|