Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 564 Bytes

File metadata and controls

27 lines (18 loc) · 564 Bytes

findIp(family: "v4" | "v6")

Returns the internal IP address.

const WebpackDevServer = require("webpack-dev-server");

const logInternalIPs = async () => {
  const localIPv4 = WebpackDevServer.findIp("v4", false);
  const localIPv6 = WebpackDevServer.findIp("v6", false);

  console.log("Local IPv4 address:", localIPv4);
  console.log("Local IPv6 address:", localIPv6);
};

logInternalIPs();

Use the following command to run this example:

node app.js

What Should Happen

  • The script should log your local IPv4 and IPv6 address.