aipi
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

aipi

Get IP information from any echoip instance

Installation

Using npm npm i aipi

Using yarn yarn add aipi

Usage

In CommonJS env

const { IPInfoFetcher } = require('aipi');

Using imports

import { IPInfoFetcher } from 'aipi';

Then

const ipInfoFetcher = new IPInfoFetcher('https://MY_EXAMPLE_ECHOIP_INSTANCE/json'); // If not provided, it uses ifconfig.co by default

const myIpInfo = await ipInfoFetcher.getInfo(); // myIpInfo is the current IP's info

const customIpInfo = await ipInfoFetcher.getInfo('9.9.9.9'); // customIpInfo is '9.9.9.9' info

Similar geo data to geoip-lite can be obtained via the getGeo method.

Documentation

See DOCS

Readme

Keywords

Package Sidebar

Install

npm i aipi

Weekly Downloads

64

Version

1.2.0

License

MIT

Unpacked Size

9.87 kB

Total Files

10

Last publish

Collaborators

  • alrico88