netkitty
Version:
Network tools kit
23 lines (22 loc) • 757 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetNetworkInterfaces = GetNetworkInterfaces;
const GetNodePcapBinding_1 = require("./lib/GetNodePcapBinding");
const sort_array_1 = __importDefault(require("sort-array"));
/**
* Get network interfaces
* @constructor
*/
function GetNetworkInterfaces() {
const ifaces = (0, GetNodePcapBinding_1.GetNodePcapBinding)().GetNetworkInterfaces();
return (0, sort_array_1.default)(ifaces.map((iface) => ({
name: iface.name,
mac: iface.mac.toLowerCase()
})), {
by: 'name',
order: 'asc'
});
}