ipopen
v0.2.0
Published
The IP-Geolocation adapter for node.
Downloads
9
Maintainers
Readme
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