MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / getIPS

Function getIPS

packages/webpack5/src/helpers/host.ts:3–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import os from 'os';
2
3export function getIPS() {
4 const interfaces = os.networkInterfaces();
5 return Object.keys(interfaces)
6 .map((name) => {
7 return interfaces[name].filter(
8 (binding: any) => binding.family === 'IPv4' || binding.family === 4
9 )[0];
10 })
11 .filter((binding) => !!binding)
12 .map((binding) => binding.address);
13}

Callers 1

base.tsFile · 0.90

Calls 3

mapMethod · 0.65
keysMethod · 0.65
filterMethod · 0.45

Tested by

no test coverage detected