Skip to content

lazyfenix/hostscope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HostScope-Banner

A service monitoring tool for checking the status of various services.

version downloads

Getting Started

Installation

Using NPM:

npm install hostscope

Using YARN:

yarn add hostscope

Usage

Monitor Options

View all of the available options.
  • name

  • host

  • method

  • port

View all of the available methods.
  • 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.

About

A service monitoring tool for checking the status of various services.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published