New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

countries-cities-geo

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

countries-cities-geo

Country & City Names, including coordinates (Lat, Lng) + country ISO name and full name

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

countries-cities-geo

Countries & City Names, including GEO coordinates (Lat, Lng) + country ISO name and full name Completely rewrote from old package name called pangnote-cities, now have the following:

  • 250 countries
  • 17k cities (big cities), you can get list of cities using getCities(country_name)

  • each country have detailed information (common & native names, sub/region, capital, currency, tld, etc)
  • GEO locations for each country & city
  • convert country name to ISO code & back

API

  • getCountries() - get array of countries
const p = require('pangnote-cities')
p.getCountries()
/*
[
  ...,
  {
    name: {
      common: 'Ukraine',
      official: 'Ukraine',
      native: { common: 'Україна', official: 'Україна' }
    },
    tld: [ '.ua', '.укр' ],
    cca2: 'UA',
    ccn3: '804',
    cca3: 'UKR',
    currency: [ 'UAH' ],
    callingCode: [ '380' ],
    capital: 'Kiev',
    altSpellings: [ 'UA', 'Ukrayina' ],
    relevance: '0',
    region: 'Europe',
    subregion: 'Eastern Europe',
    nativeLanguage: 'ukr',
    languages: { ukr: 'Ukrainian' },
    translations: {
      deu: 'Ukraine',
      fra: 'Ukraine',
      hrv: 'Ukrajina',
      ita: 'Ucraina',
      jpn: 'ウクライナ',
      nld: 'Oekraïne',
      por: 'Ucrânia',
      rus: 'Украина',
      spa: 'Ucrania'
    },
    latlng: [ 49, 32 ],
    demonym: 'Ukrainian',
    borders: [
      'BLR', 'HUN',
      'MDA', 'POL',
      'ROU', 'RUS',
      'SVK'
    ],
    area: 603500
  },
  ...
]
*/
  • getCountryNames() - get array of country names
const p = require('pangnote-cities')
p.getCountryNames()
// [ 'Afghanistan', 'Åland Islands', 'Albania', 'Algeria', ...]
  • getCities('Ukraine') - get city names of Ukraine
const p = require('pangnote-cities')
p.getCities('Ukraine')
/*
[
  'Kyiv',
  'Kharkiv',
  'Odesa',
  "L'viv",
  'Adancata',
  "Dnipropetrovs'k",
  "Donets'k",
  'Zaporizhzhya',
  "Simferopol'",
  "Luhans'k",
  'Cherkasy',
  "Ternopil'",
  ...
]
*/
  • getCountryGeo('Ukraine') - get country GEO location [lat, lng]
const p = require('pangnote-cities')
p.getCountryGeo('Ukraine')
// [ 49, 32 ]
  • getCityGeo('Ukraine', 'Kharkiv')- get city GEO location [lat, lng]
const p = require('pangnote-cities')
p.getCityGeo('Ukraine', 'Kharkiv')
// [ 49.9808, 36.2527 ]
  • getCountryISO('Ukraine') - get ISO code by country name: Ukraine -> UA
const p = require('pangnote-cities')
p.getCountryISO('Ukraine')
// 'UA'
  • getISOCountry('UA') - get country name by ISO code: UA -> Ukraine
const p = require('pangnote-cities')
p.getISOCountry('UA')
// 'Ukraine'

Keywords

FAQs

Package last updated on 10 Aug 2022

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

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