You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

eurekapi-geolocation

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eurekapi-geolocation

Nodejs wrapper for eurekapi.com ip geolocation service

2.1.0
latest
Source
npm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

eurekapi-geolocation

A basic wrapper around eurekapi's ip geolocation api

Version

2.0.1

Installation

Because eurekapi-geolocation uses native ES6 Promises and classes you must be running Node v4.2.4 or above

$ npm i eurekapi-geolocation

Usage

const Geolocator = require('eurekapi-geolocation');
var geoip = new Geolocator({
	ip: '127.0.0.1', //Some ip address string
	format: 'JSON', //"XML" or "JSON" defaults to JSON,
	apikey: 'SOMERANDOMKEY', //Your eurekapi api key
	logger: undefined, //A logger function to use defaults to console.log
	timeout: 5000, //Time in milliseconds before timing out the geolocation operation defaults to 3000
});
geoip.getLocation(function (err, data) {
	if (err) {
		console.log('Error', err);
	}
	else {
		console.log('Success', data);
	}
});

Todos

  • Add testing and more logger options

License

MIT

Keywords

ip

FAQs

Package last updated on 18 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts