1.0.8 • Published 9 months ago

hostscope v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago
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.