Socket
Book a DemoInstallSign in
Socket

country-geolocalizer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-geolocalizer

This module takes a latitude and longitude and determine the country code where it is contained.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

:warning: DEPRECATION WARNING!

Version no longer supported.

Use https://www.npmjs.com/package/geojson-places instead.

country-geolocalizer

This module takes a latitude and longitude and determine the country where it is contained.

Install

npm install --save country-geolocalizer

Testing the library

npm run test

Examples

Get country from the following latitude/longitude (Madrid):

const result = getCountry(40.4167047, -3.7035825);

console.log(result);
// {
//     ADMIN: 'Spain',
//      ISO_A3: 'ESP'
// }

Get null from a latitude/longitude in the middle of the sea:

const result = getCountry(0.0, 0.0);

console.log(result);
// null

Acknowledgment

Keywords

country

FAQs

Package last updated on 05 Jul 2021

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