npm.io
0.2.2 • Published 4 months ago

@bemedev/sleep

Licence
MIT
Version
0.2.2
Deps
0
Size
5 kB
Vulns
0
Weekly
0

The Ultimate package to sleep like a baby


With this function ( sleep ), you can sleep the time you want !

Example

import { sleep } from '@bemedev/sleep';

const myCoolFunction = async () => {
  // Go to sleep
  await sleep(2); // 100 milliseconds by default

  // Sleeping...
  // Sleeping...

  // And wake up !
  console.log("I'm awake");
};

I don't know why the core-js team doesn't include this one. So I write the simplest package in the entire history of Javascript.



Enjoy your sleep

Maybe new ways to sleep will arrive soon !

Keywords