Initial commit

This commit is contained in:
2021-08-26 21:47:42 +02:00
commit fe941c6433
1432 changed files with 161130 additions and 0 deletions

30
node_modules/ping/examples/example.js generated vendored Normal file
View File

@ -0,0 +1,30 @@
// -------- example -----------------------
'use strict';
var ping = require('../index');
var hosts = ['192.168.1.1', 'google.com', 'yahoo.com'];
hosts.forEach(function (host) {
// Running with default config
ping.sys.probe(host, function (isAlive) {
var msg = isAlive ?
'host ' + host + ' is alive' : 'host ' + host + ' is dead';
console.log(msg);
});
// Running with custom config
ping.sys.probe(host, function (isAlive) {
var msg = isAlive ?
'host ' + host + ' is alive' : 'host ' + host + ' is dead';
console.log(msg);
}, {extra: ['-i', '2']});
// Running ping with some default argument gone
ping.sys.probe(host, function (isAlive) {
var msg = isAlive ?
'host ' + host + ' is alive' : 'host ' + host + ' is dead';
console.log(msg);
}, {extra: ['-i', '2'], timeout: false});
});

41
node_modules/ping/examples/example2.js generated vendored Normal file
View File

@ -0,0 +1,41 @@
'use strict';
var ping = require('../index');
var hosts = ['192.168.1.1', 'google.com', 'yahoo.com'];
// Running with default config
hosts.forEach(function (host) {
ping.promise.probe(host)
.then(function (res) {
console.log(res);
})
.done();
});
// Running with custom config
hosts.forEach(function (host) {
// WARNING: -i 2 argument may not work in other platform like window
ping.promise.probe(host, {
timeout: 10,
extra: ['-i', '2'],
})
.then(function (res) {
console.log(res);
})
.done();
});
// Running ping with some default argument gone
hosts.forEach(function (host) {
// WARNING: -i 2 argument may not work in other platform like window
ping.promise.probe(host, {
timeout: false,
// Below extra arguments may not work in platforms other than linux
extra: ['-i', '2'],
})
.then(function (res) {
console.log(res);
})
.done();
});

35
node_modules/ping/examples/example_win_de_v6.js generated vendored Normal file
View File

@ -0,0 +1,35 @@
// -------- example -----------------------
'use strict';
var ping = require('../index');
var hosts = ['google.de']; // , '192.168.1.1', 'google.com', 'yahoo.com'];
// Running with custom config
hosts.forEach(function (host) {
ping.promise.probe(host, {
// v6: true,
min_reply: 2,
sourceAddr: 'your NIC\'s IPv6 address',
// sourceAddr: false,
})
.then(function (res) {
console.log('\n');
console.log(res);
})
.done();
// Running ping with some default argument gone
ping.sys.probe(host, function (isAlive) {
var msg = isAlive ?
'host ' + host + ' is alive' : 'host ' + host + ' is dead';
console.log('\n');
console.log(msg);
}, {
timeout: false,
// v6: true,
min_reply: 2,
sourceAddr: 'your NIC\'s IPv6 address',
});
});