Skip to content

v6.0.0

Latest
Compare
Choose a tag to compare
@sindresorhus sindresorhus released this 21 May 16:03
· 1 commit to main since this release

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...v6.0.0