Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

freegeolocate

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freegeolocate

Find coordinates of any position fast and easy no api keys required just install and use.

latest
npmnpm
Version
1.0.5
Version published
Weekly downloads
9
350%
Maintainers
1
Weekly downloads
 
Created
Source

freegeolocate

freegeolocate is a simple Node.js package that allows you to search for a location and retrieve its latitude and longitude without the need for an API key or other configurations. It provides an easy and straightforward way to get geolocation data for any place.

Features

  • No API Key Required: Start using the package immediately without any setup.
  • Easy to Use: Just pass the location name and get the geolocation data.
  • Lightweight: Minimal dependencies and efficient performance.

Installation

To install freegeolocate, use npm:

Install

npm install freegeolocate

Fetch Coordinates and Distance Between

const { fetchCoordinates, getDistanceBetween } = require('freegeolocate');

const getLocationInfo = async () => {
try {
    
    const londonLocation = await fetchCoordinates('london');
    console.log('London Coordinates:', londonLocation);

    const distance = await getDistanceBetween('london', 'pakistan');
    console.log('Distance between London and Pakistan:', distance);

} catch (error) {
    console.error('Error:', error.message);
  }
}

getLocationInfo();

Output

London Coordinates: {
address: 'London, Greater London, England, United Kingdom',
 latitude: 51.5074456,
 longitude: -0.1277653
}

Distance between London and Pakistan: { distance_miles: 3840.223890143061 }

People

The original author of freegeolocate is LinkedIn

Keywords

geolocation

FAQs

Package last updated on 22 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts