0.1.0 • Published 2 years ago

ikown-ip v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ikown-ip

ikown-ip nodejs blog

我知道IP!

I Kown IP!

Install

$ npm i ikown-ip

Usage

const ikownIP = require("ikown-ip");

const ips = ikownIP();

console.log(ips); // output for example result

result

ikown-ip well tell your current equipment ip list. This list is sorted. The rules are as follows:

  • family: IPV4 before IPV6.
  • ip: ALN IP(Local Area Network IP) before localhost IP.
[
  {
    name: 'en0', // Interfance Name
    ip: '192.168.66.191', // Your Equipment's IP.
    family: 'IPv4', // IP Family
    netmask: '255.255.240.0', // IP Netmask
    mac: '90:9c:4a:d0:0b:82' // MAC Address
  },
  {
    name: 'lo0',
    ip: '127.0.0.1',
    family: 'IPv4',
    netmask: '255.0.0.0',
    mac: '00:00:00:00:00:00'
  }
]