Releases: sindresorhus/delay
Releases · sindresorhus/delay
v6.0.0
Breaking
- Require Node.js 16 b2edac7
- This package is now pure ESM. Please read this.
- Removed the
delay.reject()
method.- It's not really needed anymore with async/await. Just throw an error after awaiting the delay.
const delay = require('delay'); delay.clear(…);
→import {clearDelay} from 'delay'; clearDelay(…);
const delay = require('delay'); delay.range(…);
→import {rangeDelay} from 'delay'; rangeDelay(…);
const delay = require('delay'); delay.createWithTimers(…);
→import {createDelay} from 'delay'; createDelay(…);
If you only target Node.js and not the browser, I recommend moving to the built-in method whenever possible:
import {setTimeout} from 'node:timers/promises';
await setTimeout(1000);
v5.0.0
v4.4.1
- Loosen up the
createWithTimers
types df95c9e
v4.4.0
v4.3.0
v4.2.0
v4.1.0
v4.0.0
The value
argument is now an options-object.
- await delay(100, '🦄');
+ await delay(100, {value: '🦄'});
And we added support for AbortController.