IP UTILITY
Installation
You can install with npm:
$ npm install ip-utility --save
You can also install through yarn:
$ yarn add ip-utility
Features
It`s written in Typescript then you can access to the relative data types. This package exposes 2 functions
- getPublic
- getPrivate
getPublic
This is an async function that return you a string with your public ip
Without async
const getPublic = ;
With async
{const getPublic = ; const ip = await ;console;}
getPrivate( options )
- ##### options
- ###### wifi
- ###### not required
- ###### boolean
- ###### return an array of object or an single object that describes all Wi-Fi
interfaces
- ###### ethernet
- ###### not required
- ###### boolean
- ###### return an array of object or an single object that describes all Ethernet
interfaces
- ###### wifi
const getPrivate = ; // Only 1 wifi interfaceconst ip = ; console;console;