get-local-ip

Get a local IP address from a specified network range

Usage no npm install needed!

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

README

get-local-ip

npm travis climate deps gratipay

Get a local IP address from a specified network range.

Install

$ npm i -S get-local-ip

Usage

var getLocalIP = require('get-local-ip');

console.log(getLocalIP('192.168.0.0/24'));

It will loop through all of your network interfaces and return the first matched IPv4 address.

See IP Calculator for the further help.

License

WTFPL