Skip to content

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

License

Notifications You must be signed in to change notification settings

distributedlife/get-ip-addresses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published