timemate
v1.0.11
Published
timemate is a toolbox for calling time options and await patterns
Downloads
6
Readme
TimeMate
TimeMate is a lightweight time-based toolbox built with ethers development in mind.
Installation
Using npm:
npm i timemate
Importing jsonlitedb to your Node Project:
const timemate = require(‘timemate’)
Usage
TimeMate features two functions:
wait
Halts your script for your defined period of time.
This function has one mandatory parameter:
- Your desired delay in milliseconds
Example
await wait(5000)
// Expected result: script would wait for 5 seconds.
unixTimestamp
Converts current time in milliseconds to seconds in unix format.
This function has no parameters
Example
// If today were January 1st, 2000 at 10:00 (1/1/2000 10:00)
unixTimeStamp() // Would return: 946749600