npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

ipify

3.0.0 • Public • Published

ipify Build Status

Get your public IP address

Using the ipify API or a custom ipify instance.

Install

$ npm install ipify

Usage

const ipify = require('ipify');
 
(async => {
    console.log(await ipify());
    //=> '82.142.31.236'
})();

API

ipify([options])

Returns a Promise<string> with an IP address.

options

Type: object

endpoint

Type: string
Default: 'https://api.ipify.org'

Custom API endpoint.

Related

License

MIT © Sindre Sorhus

install

npm i ipify

Downloadsweekly downloads

5,344

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability