hostscope
v1.0.8
Published
A service monitoring tool for checking the status of various services.
Downloads
557
Maintainers
Keywords
Readme
npm install hostscope
yarn add hostscope
name
host
method
port
TCP
UDP
GET
PING
const HostScope = require('hostscope').default;
const hostScope = new HostScope();
hostScope.addService('Google', { host: 'google.com', method: 'TCP', port: 80 });
(async () => {
console.log('Checking Google TCP status:');
try {
const status = await hostScope.getStatus('Google');
console.log(status);
} catch (error) {
console.error(`Error: ${error.message}`);
}
})();
Checking Google TCP status:
{
"Google": {
"host": "google.com",
"port": 80,
"method": "tcp",
"status": "Online",
"latency": "150 ms"
}
}
If you have any issues don't hesitate to report it via GitHub Issues.
This package was made by @lazyfenix.