Supports UptimeKuma versions from 1.13.1 to 1.23.13
npm install uptimekuma-api
let kuma = new UptimeKuma("https://kuma.url/");
kuma.startPushing("push code",60);
kuma.cancelPushing("push code");
or to stop all pushes
kuma.cancelPushing();
kuma.on("prePush", (url, params) => {
params.msg = "test";
params.status = "down";
});
for (let x of (await kuma.status())) {
for (let monitor of x.monitors) {
console.log(monitor.name + " " + monitor.heartbeats[1].status+ " - " + (monitor.uptime*100) + "%");
}
}
await kuma.login("username", "password");
console.log(await kuma.getDatabaseSize());