Socket
Socket
Sign inDemoInstall

gre-geoip

Package Overview
Dependencies
2
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gre-geoip

The official JS library for GRE GeoIP API.


Version published
Maintainers
1
Created

Readme

Source

GRE GeoIP for JS & Node.js

The official JS library for GRE GeoIP API


Report Issue · Request Feature · API Home Page · API Docs




npm version    GitHub code size in bytes    License: MIT    API Status

Requirements

No requirements for using this package.

Installation

For Node.js, React.js & React Native:

npm i gre-geoip --save

or

yarn add gre-geoip

For Browser:

<script src="https://cdn.jsdelivr.net/gh/gre-dev/GeoIP-JS@latest/gre-geoip.min.js"></script>



Usage

Let's say that we want to get the visitor IP Address. So we do the following:

For Node.js, React.js & React Native:

const GREGeoIP = require('gre-geoip');
const GeoIP = new GREGeoIP('<API-Key>');

GeoIP.geoip({}).then(res => {
    console.log(res?.data?.ip);
});

For Browser:

<script>
    const GeoIP = new GREGeoIP('<API-Key>');

    GeoIP.geoip({}).then(res => {
        console.log(res?.data?.ip);
    });
</script>



Options, Methods and More

You can find the full guide of this package by visiting our Documentation Page.



Credits



License

The MIT License (MIT). Please see License File for more information.

Keywords

FAQs

Last updated on 04 Feb 2022

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc