get-ip-addresses

Returns a list of IPV4 addresses for the computer the script is run on

Usage no npm install needed!

<script type="module">
  import getIpAddresses from 'https://cdn.skypack.dev/get-ip-addresses';
</script>

README

get-ip-addresses

Returns array of IPV4 Address for this machine.

Install

npm i get-ip-addresses -S

Use

ES6

import getIpAddresses from 'get-ip-addresses';
console.log(getIpAddresses());

Ye Olde

var getIpAddresses = require('get-ip-addresses').getIpAddresses;
console.log(getIpAddresses());

Refresh IP Addresses

By default, the list of IP addresses is cached. To force a refresh, you can pass an additional parameter.

getIpAddresses(true);

Kudos

Liberated from this StackOverflow answer: http://stackoverflow.com/a/8440736

Ryan Boucher