
A service monitoring tool for checking the status of various services.
Getting Started
Installation
Using NPM:
npm install hostscope
Using YARN:
yarn add hostscope
Usage
Monitor Options
<summary>View all of the available options.</summary>
name
host
method
port
<summary>View all of the available methods.</summary>
TCP
UDP
GET
PING
Import and usage example
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}`);
}
})();
Output example
Checking Google TCP status:
{
"Google": {
"host": "google.com",
"port": 80,
"method": "tcp",
"status": "Online",
"latency": "150 ms"
}
}
Do you have any issues?
If you have any issues don't hesitate to report it via GitHub Issues.
This package was made by @lazyfenix.