ipopen

0.2.0 • Public • Published

IpOpEn

The IP-Geolocation adapter 🎧 for node.

Install

npm i ipopen

Usage

The callbacks ☎ way

const ipopen = require('ipopen');
 
ipopen('157.37.165.132', (geo, err) => {
  if (err) throw err
  console.log(geo);
})

The promises 👏 way

const ipopen = require('ipopen');
 
ipopen('157.37.165.132')
  .then(geo => console.log(geo))
  .catch(err => console.error(err));

The async/await 💓 way

const ipopen = require('ipopen');
 
(async () => {
  try {
    console.log(await ipopen('157.37.165.132'))
  } catch (err) {
    console.error(err)
  }
})()

Lastly

Uses https://github.com/maddhruv/open-ip internally

Package Sidebar

Install

npm i ipopen

Weekly Downloads

3

Version

0.2.0

License

ISC

Unpacked Size

1.59 kB

Total Files

3

Last publish

Collaborators

  • maddhruv