Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

country-iso

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

country-iso - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

17

index.js

@@ -32,5 +32,20 @@ 'use strict';

/**
* Searches for every country which contains the point (lat, lng)
* @param {Number} lat Latitude of the point
* @param {Number} lng Longitude of the point
* @return {String[]} Array of ISO 3166 alpha-3 country code for the geographic coordinates
*/
function getCodeSync(lat, lng) {
if (this.worldGeojson === undefined) {
throw new Error('No geographical data loaded');
}
const countries = this.worldLookup.search(lng, lat, -1);
return countries.features.map(f => f.properties.ISO_A3);
}
module.exports = {
use: useGeoJSON,
get: getCode
get: getCode,
getSync: getCodeSync
};

2

package.json
{
"name": "country-iso",
"version": "1.0.3",
"version": "1.0.4",
"description": "Get ISO 3166-1 alpha-3 country code for geographic coordinates.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -54,3 +54,18 @@ # country-iso

Longitude of the point.
### getSync(lat, lng)
Searches for every country which contains the point (lat, lng).
#### lat
Type: `number`
Latitude of the point.
#### lng
Type: `number`
Longitude of the point.
## Authors

@@ -57,0 +72,0 @@ * **Matteo Chen** - [chq-matteo](https://github.com/chq-matteo)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc