Welcome aboard! We are happy you are here and wish you good net-raft!
// type "node script.js" in command prompt
// code below insert into script.js
var os = require('os');
var interfaces = os.networkInterfaces();
var addresses = [];
for (var k in interfaces) {
for (var k2 in interfaces[k]) {
var address = interfaces[k][k2];
if (address.family === 'IPv4' && !address.internal) {
addresses.push(address.netmask);
}
}
}
console.log(addresses);
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 8K 1.7K