Skip to content

user location finder package provides a simple and efficient way to retrieve the user's current location

Notifications You must be signed in to change notification settings

bdhamithkumara/user-location-finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

user-location-finder

npm version

Install

yarn add user-location-finder

or

npm i user-location-finder

Sneakpeek

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

About

user location finder package provides a simple and efficient way to retrieve the user's current location

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published