npm.io
1.1.2 • Published 6 years ago

@sprnz/wait

Licence
ISC
Version
1.1.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0

@sprnz/wait

Wait a specified number of seconds before resolving.

Usage

import wait from '@sprnz/wait';

(async function() {
  const ms = await wait(500); // will resolve after 500ms
  console.log(ms); // 500

  const value = await wait(200, 'Hello'); // will resolve after 200ms
  console.log(value); // 'Hello'
})();

Keywords