Skip to content

Commit 50612dc

Browse files
committed
Added new function getPrimaryNetworkInterfaces
1 parent de823fa commit 50612dc

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lup-system",
3-
"version": "1.5.3",
3+
"version": "1.5.4",
44
"description": "NodeJS library to retrieve system information and utilization.",
55
"main": "./lib/index",
66
"types": "./lib/index.d.ts",

src/net.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,14 @@ export function isPublicIp(ip: string): boolean {
302302
return false;
303303
}
304304

305-
export async function getRealNetworkInterfaces(): Promise<NICInfo[]> {
305+
/**
306+
* Returns the primary network interfaces on the system.
307+
*
308+
* @returns List of primary NICInfo objects.
309+
*/
310+
export async function getPrimaryNetworkInterfaces(): Promise<NICInfo[]> {
306311
const allNics = await getNetworkInterfaces();
307-
return allNics.filter((nic) => true);
312+
return allNics.filter((nic) => nic.primary);
308313
}
309314

310315
/**

0 commit comments

Comments
 (0)