server-reachability
v1.2.8
Published
This is a node.js plugin, which allows you to check, if different types of servers are online. ๐พ๐ก
Downloads
23
Maintainers
Readme
ServerReachability
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 termianl.
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 an 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 it 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. Cick the badge on the top.