server-reachability

1.2.8 • Public • Published

ServerReachability

npm npm GitHub Lines of code 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 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.

License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.8
    1
    • latest

Version History

Package Sidebar

Install

npm i server-reachability

Weekly Downloads

16

Version

1.2.8

License

MIT

Unpacked Size

6.53 kB

Total Files

10

Last publish

Collaborators

  • minomy13