Install
$ npm i web-uptimer
Setup
const up = require('web-uptimer');
const uptimer = new up.Uptimer({ timeout: 30000});
Logging
const uptimer = new up.Uptimer({ timeout: 1000, pingLog: true })
const uptimer = new up.Uptimer({ timeout: 1000, pingLog: true, pingMessage: '{url} was pinged'})
Example
const uptimer = new up.Uptimer({ timeout: 8000, client: 'node-fetch' });
uptimer.add('https://example.com', '123456789123456789')
uptimer.startAll();
setTimeout(() => {
uptimer.substring('https://example.com', '123456789123456789');
uptimer.restart('123456789123456789');
}, 4000)
Get all
uptimer.allById('123456789123456789').then(array => console.log(array));
uptimer.all().then(array => console.log(array));
Clients
Endpoints
Value |
Param |
Output |
add |
url, id |
true |
substring |
url, id |
true |
allById |
id |
array |
start |
id |
true |
stop |
id |
true |
restart |
|true |
|
all |
|array |
|
startAll |
|true |
|
stopAll |
|true |
|
restartAll |
|true |
|
Youtube, Discord