constup=require('web-uptimer');constuptimer=newup.Uptimer({timeout: 30000});//5m//You can use also client: 'node-fetch' or 'got'
Logging
constuptimer=newup.Uptimer({timeout: 1000,pingLog: true})//logging on the console when ping urlconstuptimer=newup.Uptimer({timeout: 1000,pingLog: true,pingMessage: '{url} was pinged'})//https://example.com was pinged | {url} = the url who is pinged
Example
/** * Pinging url every 8s * Stopping after 4s * Only Example */constuptimer=newup.Uptimer({timeout: 8000,client: 'node-fetch'});uptimer.add('https://example.com','123456789123456789')//id/name: stringuptimer.startAll();setTimeout(()=>{uptimer.substring('https://example.com','123456789123456789');uptimer.restart('123456789123456789');//update fetching},4000)