npm install longitude> Geolocation for node
```
$ npm install --save longitude
js
const longitude = require('longitude');longitude('8.8.8.8').then(data => {
console.log(data);
// => {
// => ip: '8.8.8.8',
// => country_code: 'US',
// => country_name: 'United States',
// => latitude: 37.751,
// => longitude: -97.822,
// => ...
// => }
});
`$3
`js
const longitude = require('longitude');longitude().then(data => {
console.log(data);
// => {
// => ip: Your IP,
// => ...
// => }
});
`API
$3
Returns a promise with the geoip data#### ip
Type:
string`The IP - Address you want to check
MIT © Tobias Herber