Skip to content

This is a node.js module, which allows you to check, if different types of servers are online. 💾📡

License

Notifications You must be signed in to change notification settings

minomy13/server-reachability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServerReachability

npm GitHub GitHub code size in bytes

This is a node.js module, which allows you to check, if different types of servers are online. Check the other sections for information about the installation and usage. 💾📡

Installation

You can install it like every other npm package. Simply run npm install server-reachability in your terminal.

Usage

After installing, you can begin to use it. At first you should import it, like:

const sr = require('server-reachability');

isReachable

The isReachable function is asynchronous and gives back a boolean (true or false). So you have to await it. You have to give a hostname, a port and a timeout in milliseconds to it. If values are missing it will log that and allways return false. Code example:

// Imports...

async function fn() {
  console.log(await sr.isReachable('google.com', 80, 5000));
}

fn();

Output:

true

Support

If you have questions, you can ask me everytime on my Discord. Just click the badge ;)

License

About

This is a node.js module, which allows you to check, if different types of servers are online. 💾📡

Topics

Resources

License

Stars

Watchers

Forks