1.0.3 • Published 1 year ago

user-location-finder v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

user-location-finder

npm version

Install

yarn add user-location-finder

or

npm i user-location-finder

Sneakpeek

npm.io

Demo

Live Demo

Usage

import getUserLocation from 'user-location-finder';

getUserLocation()
    .then(location => {
        console.log(`Country: ${location.country}, Town: ${location.town}`);
    })
    .catch(error => {
        console.error('Error fetching location:', error);
    });

About

The user location finder package provides a simple and efficient way to retrieve the user's current location, including the country and town/city, directly from their browser. It utilizes the browser's built-in Geolocation API combined with the BigDataCloud reverse geocoding service to convert geographical coordinates (latitude and longitude) into readable location information.

Features

  • Easy to Use - Simple API that allows you to get the user's country and town with a single function call.
  • No API Key Required - Uses BigDataCloud's free reverse geocoding service, so no API key is needed for basic usage.
  • Real-Time Location - Retrieves the user's location in real-time using the browser's Geolocation API.
  • Lightweight - Minimal dependencies, ensuring fast performance and easy integration into any JavaScript or Node.js project.

Dependencies

axios for making HTTP requests to the BigDataCloud API.

License

MIT

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago