const os = require('os');
const net = os.networkInterfaces();
let ip = net.eth0[0].address;
require('os')
- module to work withOS
.networkInterfaces()
- returns data on all network interfacesnet.eth0[0].address
- returns first IP address ofeth0
interface
group: hostname
const os = require('os');
const net = os.networkInterfaces();
console.log(net.eth0[0].address);
135.181.98.214
link_youtube: https://youtu.be/4DYtx9WoKDk