1.5.0 • Published 4 years ago

web-uptimer v1.5.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Install

$ npm i web-uptimer

Setup

const up = require('web-uptimer');
const uptimer = new up.Uptimer({ timeout: 30000}); //5m
//You can use also client: 'node-fetch' or 'got'

Logging

const uptimer = new up.Uptimer({ timeout: 1000, pingLog: true }) //logging on the console when ping url

const uptimer = new up.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 */

const uptimer = new up.Uptimer({ timeout: 8000, client: 'node-fetch' });

uptimer.add('https://example.com', '123456789123456789') //id/name: string

uptimer.startAll();

setTimeout(() => {
    uptimer.substring('https://example.com', '123456789123456789');
    uptimer.restart('123456789123456789'); //update fetching
}, 4000)

Get all

uptimer.allById('123456789123456789').then(array => console.log(array));

uptimer.all().then(array => console.log(array));

Clients

Endpoints

ValueParamOutput
addurl, idtrue
substringurl, idtrue
allByIdidarray
startidtrue
stopidtrue
restarttrue
allarray
startAlltrue
stopAlltrue
restartAlltrue

Contact

Youtube, Discord

1.5.0

4 years ago

0.0.1-first

4 years ago

0.0.1

4 years ago

1.0.2-b

4 years ago

1.0.2-log

4 years ago

1.0.2-a

4 years ago

1.0.2

4 years ago

1.0.1-c

4 years ago

1.0.1-b

4 years ago

1.0.1-a

4 years ago

1.0.1-array

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago