Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6
jaywcjlove/local-ip-url
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Get current machine IP.
npm install local-ip-url --save-dev
constlocalIpUrl=require('local-ip-url');localIpUrl()// => 192.168.31.69localIpUrl('public')// => 192.168.31.69localIpUrl('public','ipv4')// => 192.168.31.69localIpUrl('public','ipv6')// => fe80::c434:2eff:fe06:f90localIpUrl('private')// => 127.0.0.1localIpUrl('private','ipv4')// => 127.0.0.1localIpUrl('private','ipv6')// => fe80::1
constprepareUrls=require('local-ip-url/prepareUrls');prepareUrls({protocol:'http',host:'0.0.0.0',port:3001});// ===output==>// {// ip: '192.168.31.69',// localUrl: 'http://localhost:3001/',// lanUrl: 'http://192.168.31.69:3001/'// }
As always, thanks to our amazing contributors!
Made withcontributors.
MIT
About
Get current machine IP.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.