find-my-location
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

find-my-location

Find user location from their ip

Install

Using npm:

npm install find-my-location

or if you prefer using yarn:

yarn add find-my-location

Usage

import fml from "find-my-location";
// or if you don't use ES6 import:
// const fml = require("find-my-location").default;

const dummy = async () => {
  const location = await fml("112.69.120.199");

  console.log(location);
};

dummy();

/*
  The response will be:
  {
    ip: "112.69.120.199",
    country_code: "JP",
    country_name: "Japan",
    region_code: "27",
    region_name: "Ōsaka",
    city: "Osaka",
    zip_code: "543-0062",
    time_zone: "Asia/Tokyo",
    latitude: 34.6851,
    longitude: 135.5136,
    metro_code: 0
  }
*/

Dependencies

This library uses freegeoapi API to function, we are allowed up to 15,000 requests per hour.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.348latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.348
1.0.20
1.0.11
1.0.01

Package Sidebar

Install

npm i find-my-location

Weekly Downloads

10

Version

1.0.3

License

MIT

Unpacked Size

7.5 kB

Total Files

4

Last publish

Collaborators

  • nttanh6299