1.0.0 • Published 3 months ago

quickly-ip v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

quickly-ip

npm version npm downloads

Get public network ip under browser and node.js

install

npm i quickly-ip

usage

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

// es6
import { getIP } from 'quickly-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 300ms