blob: aaddbeee9bf9a1feabc95746491460c518431eea (
plain)
1
2
3
4
5
6
7
8
9
|
const os = require("node:os");
const INTERFACE_FAMILIES = ["IPv4"];
module.exports = function() {
return Object.values(os.networkInterfaces()).flat().filter(interface => {
return interface.internal === false && INTERFACE_FAMILIES.includes(interface.family);
}).map(interface => interface.address);
};
|