Socket
Book a DemoInstallSign in
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
npmnpm
Version published
Weekly downloads
0
-100%
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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.