npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

geoplugin

v1.0.10

Published

Geo plugin provided geolocation data of user's browser using services provided by http://www.geoplugin.net/

Downloads

161

Readme

GEOPLUGIN

Features

  • Get geolocation of visitor's browser
  • Get geolocation by IP
  • Supports the Promise API
  • Automatic transforms for JSON data
  • Free geolocation data provided by http://www.geoplugin.net/

Browser Support

Chrome | Firefox | Safari | Opera | Edge | IE | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |

Limitation

This plugin uses both free and premium versions of geoPlugin. Free version comes with a limitation of 120 lookups per minute. Free version doesn't allow to use secure network request over https protocol. To subscribe geoPlugin premium services please refer to their website Premium IP geolocation access

Installing

Using npm:

$ npm install geoplugin

Using yarn:

$ yarn add geoplugin

Example

usage( free version)

import {getGeo, getGeoByIp} from 'geoplugin';

Getting geolocation of user's browser.

import {getGeo} from 'geoplugin';

// Get geolocation of a user's browser.
getGeo()
  .then(response => console.log(response)) // handle success
  .catch(error => console.log(error)) // handle error
  .then(() => {  }); // always executed

Getting geolocation by an ip address.

import {getGeoByIp} from 'geoplugin';

// Get  geolocation by an ip address.
getGeoByIp('xx.xx.xx.xx')
  .then(response => console.log(response)) // handle success
  .catch(error => console.log(error)) // handle error
  .then(() => {  }); // always executed

usage( premium version)

import {getGeoSSL, getGeoByIpSSL} from 'geoplugin';

Getting geolocation of user's browser.

import {getGeoSSL} from 'geoplugin';

// Get geolocation of a user's browser using premium service.
getGeoSSL('licenseKey')
  .then(response => console.log(response)) // handle success
  .catch(error => console.log(error)) // handle error
  .then(() => {  }); // always executed

Getting geolocation by an ip address.

import {getGeoByIpSSL} from 'geoplugin';

// Get  geolocation by an ip address  using premium service.
getGeoByIpSSL('licenseKey','xx.xx.xx.xx')
  .then(response => console.log(response)) // handle success
  .catch(error => console.log(error)) // handle error
  .then(() => {  }); // always executed

Example Response Object

{
  request: '11.222.333.44',
  status: 200,
  delay: '2ms',
  areaCode: '',
  city: 'Manhattan',
  continentCode: 'NA',
  continentName: 'North America',
  countryCode: 'US',
  countryName: 'United States',
  credit: "Some of the returned data includes GeoLite data created by MaxMind, available from <a href='http://www.maxmind.com'>http://www.maxmind.com</a>.",
  currencyCode: 'USD',
  currencyConverter: 1,
  currencySymbol: '$',
  currencySymbol_UTF8: '$',
  dmaCode: '501',
  euVATRate: false,
  inEU: 0,
  locationAccuracyRadius: '1',
  latitude: '12.345',
  longitude: '-67.890',
  region: 'New York',
  regionCode: 'NY',
  regionName: 'New York',
  timezone: 'America/New_York'
}

Promises

geoplugin depends on a native ES6 Promise implementation to be supported. If your environment doesn't support ES6 Promises, you can polyfill.

Credits

geoplugin is a simple wrapper for REST API provided by geoplugin.com. geoPlugin provides a free geolocation API in multiple different programming languages in a single API call. There is no software installation required, no API key and whether your programming language of choice be Javascript, PHP, XML, JSON, ASP, or CSV, geoPlugin has a way to simply and efficiently geo-localize your visitors.

IP Geolocation by geoPlugin

This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com

License

MIT