1.0.24 • Published 12 months ago

react-ip-location v1.0.24

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

react-ip-location

  • Simplest, lightest and fastest JS library to get your ip address and location.

  • Check current location by a provided ip address.

NPM JavaScript Style Guide

Table of Contents

Features

  • getIPLocation();
  • checkIPLocation('your-ip-address');
  • Supports the Promise

Browser Support

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔11 ✔

Installing

Package manager

Using yarn:

$ yarn add react-ip-location

Using npm:

$ npm install react-ip-location

Usage

import React from 'react';
import { getIPLocation, checkIPLocation } from 'react-ip-location';


export const App = () => {
  getIPLocation().then(result => {
    // console.log(result);
  });
  checkIPLocation('42.115.92.231').then(result => {
    // console.log(result);
  });

  // Or declare an async function in your component
  const getMyIP = async () => {
      const location = await getIPLocation();
      return console.log("my location", location);
  };
  
  getMyIP();

  return <div>PAGE COTNENT</div>

};

License

MIT © HFrontend


1.0.24

12 months ago

1.0.23

12 months ago

1.0.22

12 months ago

1.0.21

12 months ago

1.0.20

12 months ago

1.0.19

12 months ago

1.0.18

12 months ago

1.0.17

12 months ago

1.0.16

12 months ago

1.0.15

12 months ago

1.0.14

12 months ago

1.0.13

12 months ago

1.0.12

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago