qiao-get-ip

5.0.3 • Public • Published

qiao-get-ip

npm version npm downloads

Get public network ip under browser and node.js.

install

npm i qiao-get-ip

usage

// commonjs
const { getIP } = require('qiao-get-ip');

// es6
import { getIP } from 'qiao-get-ip';

api

getIP

get public network ip

  • timeout
    • type: number
    • desc: timeout, ms, default: 300ms
  • debug
    • type: boolean
    • desc: whether to display debug logs, default: false
  • return
    • type: string
    • desc: ip
// ip
const ip = await getIP(timeout);

// ip debug
const ip = await getIP(timeout, true);

fast

Request the following websites and return the fastest response. The default timeout is 200ms

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i qiao-get-ip

    Weekly Downloads

    18

    Version

    5.0.3

    License

    MIT

    Unpacked Size

    9.47 kB

    Total Files

    6

    Last publish

    Collaborators

    • npm_insistime