1.0.24 • Published 2 years ago
react-ip-location v1.0.24
react-ip-location
Simplest, lightest and fastest JS library to get your ip address and location.
Check current location by a provided ip address.
Table of Contents
Features
- getIPLocation();
- checkIPLocation('your-ip-address');
- Supports the Promise
Browser Support
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
2 years ago
1.0.23
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago