Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hostscope

lazyfenix28MIT1.0.8TypeScript support: included

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

HostScope, host-scope, lazyfenix, network monitoring, service status, uptime monitoring, availability check, performance monitoring, TCP monitoring, UDP monitoring, HTTP monitoring, ping test, Node.js networking, website uptime, server availability, API status checker, lightweight monitoring, fast network checks, open-source tools, error handling in network, latency measurement, custom monitoring solutions, async network requests, web development, javascript, node, npm, react, vue, typescript, express, web server, devops, monitoring tools, logging, performance, debugging, api monitoring

readme

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

<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.