Skip to content

Very simple Node.js module to make system level ping. Windows, Linux, Max supported

License

Notifications You must be signed in to change notification settings

lawlietmester/ping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this

This is very simple promise-based module to make system-level ping requests. Works in Windows / Linux / Mac.

Requirements

Node 8+

How to install

npm install system-ping

How to use

const ping = require( 'system-ping' );
ping( '127.0.0.1' ).then( ({ total, received }) => {
	console.log( `Sent ${total} packets, received ${received} packets` );
	if( total === received ){
		console.log( 'Ping was successful' );
	}
	else{
		console.warn( 'Some problems with host 127.0.0.1' );
	}
});

Options

ping( '127.0.0.1', { 'packetsCount': 8 } ) // How much packets to send for this ping

About

Very simple Node.js module to make system level ping. Windows, Linux, Max supported

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published