@yehonadav/timeunit
v1.0.4
Published
Replace JSON.stringify with safeStringify to stringify circular objects
Downloads
4
Maintainers
Readme
timeunit
install
npm i @yehonadav/timeunit
stop using syntax const wait = 24 * 60 * 60 * 1000
to represent time units.
use a time unit instead:
usage
import {seconds} from "@yehonadav/timeunit"
function sleep(milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds))
.then(() => {
console.log(`waited ${milliseconds/second} seconds`)
})
}
sleep(60 * seconds)
enjoy =)