1.2.11 • Published 4 years ago

@rochismo/net-utils v1.2.11

Weekly downloads
28
License
ISC
Repository
github
Last release
4 years ago

NodeJS Net Utils

This module's purpose is to make networking tasks simpler

Getting Started

To run some of the functions of the module, you must run the program as a sudo user on linux systems, since it uses the raw-socket module on a module dependency (net-ping) by @stephenwvickers

Installing

To install the module just run

npm install @rochismo/net-utils --save

Functionality

For now, this module is capable of:

  • Get your active interface ip / gateway / network-cidr
  • Ping a single host
  • Ping sweep your network CIDR (Or any range of hosts within a specified CIDR)
  • Track progress of ping sweep
    • Send the progress through a Server Sent Event

Sample usage

Module instantiation

const {pinger, utils} = require('@rochismo/net-utils');

Get your active interface info

(async function(){
    const data = await utils.getDetails();
    console.log(data);
})();

Ping a single host

(async function() {
    console.log(await pinger.ping("192.168.1.1"))

    console.log(await pinger.ping("192.168.1.50"))
})()

Ping sweep

(async function() {
    const aliveHosts = await pinger.pingSweep("192.168.1.0/24") // If you didn't instantiate without a ip + CIDR

    /* 
        Sample output: ["192.168.1.1", "192.168.1.5"]
    */

})()

TODO

  • Make the module more functional
  • Export all functionalities
  • Refactor Pinger class
1.2.8

4 years ago

1.2.9

4 years ago

1.2.10

4 years ago

1.2.11

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.3

4 years ago

1.2.4-hotfix

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago