npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

countries-languages

v1.0.3

Published

Countries data (general, languages, geo, anthems, etc)

Downloads

584

Readme

countries-languages

The project contains json data files. The data is about countries, languages codes and anthems.

Table of Contents

Installation

npm install countries-languages
const { anthems, countries, languages } = require('countries-languages');

Countries Data

The countries data based on iso_3166_1_alpha2 (a2) countries codes.

Data Structure

  • name
    • common - common name in english
    • official - official name in english
    • native - list of all native names
      • key: three-letter ISO 639-3 language alpha code
      • value: name object
        • key: official - official name translation
        • key: common - common name translation
  • demonym - name of residents
  • capital - capital city
  • iso_3166_1_alpha2 - code ISO 3166-1 alpha-2
  • iso_3166_1_alpha3 -code ISO 3166-1 alpha-3
  • iso_3166_1_numeric - code ISO 3166-1 numeric
  • currency - ISO 4217 currency code(s)
    • key: three-letter ISO 4217 currency code
    • value: currency object
      • key: iso_4217_code - three-letter ISO 4217 currency alpha code
      • key: iso_4217_numeric - three-number ISO 4217 currency numeric code
      • key: iso_4217_name - official ISO 4217 currency name
      • key: iso_4217_minor_unit - minor currency unit
  • tld - country code top-level domain
  • alt_spellings - alternative spellings
  • languages - list of official languages
    • key: three-letter ISO 639-3 language code
    • value: name of the language in english
  • translations - list of name translations
    • key: three-letter ISO 639-3 language code
    • value: name object
      • key: official - official name translation
      • key: common - common name translation
  • geo
    • continent - continents that country lies in
      • key: two-letter continent code
      • value: name of the continent in english
    • postal_code - geographical area postal code
    • latitude - short form of latitude coordinate point
    • latitude_dec - described latitude coordinate point
    • longitude - short form of longitude coordinate point
    • longitude_dec - described longitude coordinate point
    • max_latitude - maximum latitude coordinate point
    • max_longitude - maximum longitude coordinate point
    • min_latitude - minimum latitude coordinate point
    • min_longitude - minimum longitude coordinate point
    • area - land area in km²
    • region - geographical region
    • subregion - geographical sub-region
    • world_region - geographical world region
    • region_code - geographical region numeric code
    • subregion_code - geographical sub-region numeric code
    • landlocked - landlocked status
    • borders - land borders
    • independent - independent status
  • dialling
    • calling_code - calling code(s)
    • national_prefix - national prefix
    • national_number_lengths - national number lengths
    • national_destination_code_lengths - national destination code lengths
    • international_prefix - international prefix
  • extra
    • geonameid - Geoname ID
    • edgar - Electronic Data Gathering, Analysis, and Retrieval system
    • itu - Codes assigned by the International Telecommunications Union
    • marc - MAchine-Readable Cataloging codes from the Library of Congress
    • wmo - Country abbreviations by the World Meteorological Organization
    • ds - Distinguishing signs of vehicles in international traffic
    • fifa - Codes assigned by the Fédération Internationale de Football Association
    • fips - Codes from the U.S. Federal Information Processing Standard
    • gaul - Global Administrative Unit Layers from the Food and Agriculture Organization
    • ioc - Codes assigned by the International Olympics Committee
    • cowc - Correlates of War character
    • cown - Correlates of War numeric
    • fao - Food and Agriculture Organization
    • imf - International Monetary Fund
    • ar5 - Fifth Assessment Report (AR5)
    • address_format - Address forma
    • eu_member - European Union Member
    • vat_rates - Value-Added Tax
  • population
    • count - population number
    • worldPercentage - country population of world population percentage
  • wikiLink - relative link to country wikipedia page

Example: Iran

{
  "IR": {
    "name": {
      "common": "Iran",
      "official": "Islamic Republic of Iran",
      "native": {
        "fas": {
          "official": "جمهوری اسلامی ایران",
          "common": "ایران"
        }
      }
    },
    "demonym": "Iranian",
    "capital": "Tehran",
    "iso_3166_1_alpha2": "IR",
    "iso_3166_1_alpha3": "IRN",
    "iso_3166_1_numeric": "364",
    "currency": {
      "IRR": {
        "iso_4217_code": "IRR",
        "iso_4217_numeric": 364,
        "iso_4217_name": "Iranian rial",
        "iso_4217_minor_unit": 2
      }
    },
    "tld": [
      ".ir",
      "ایران."
    ],
    "alt_spellings": [
      "IR",
      "Islamic Republic of Iran",
      "Iran, Islamic Republic of",
      "Jomhuri-ye Eslāmi-ye Irān"
    ],
    "languages": {
      "fas": "Persian"
    },
    "translations": {
      "deu": {
        "official": "Islamische Republik Iran",
        "common": "Iran"
      },
      "fra": {
        "official": "République islamique d'Iran",
        "common": "Iran"
      },
      "hrv": {
        "official": "Islamska Republika Iran",
        "common": "Iran"
      },
      "jpn": {
        "official": "イラン·イスラム共和国",
        "common": "イラン・イスラム共和国"
      },
      "nld": {
        "official": "Islamitische Republiek Iran",
        "common": "Iran"
      },
      "por": {
        "official": "República Islâmica do Irã",
        "common": "Irão"
      },
      "rus": {
        "official": "Исламская Республика Иран",
        "common": "Иран"
      },
      "spa": {
        "official": "República Islámica de Irán",
        "common": "Iran"
      },
      "fin": {
        "official": "Iranin islamilainen tasavalta",
        "common": "Iran"
      }
    },
    "geo": {
      "continent": {
        "AS": "Asia"
      },
      "postal_code": true,
      "latitude": "32 00 N",
      "latitude_dec": "32.50077819824219",
      "longitude": "53 00 E",
      "longitude_dec": "54.2942008972168",
      "max_latitude": "39.7754",
      "max_longitude": "62",
      "min_latitude": "25.05",
      "min_longitude": "27.4455",
      "area": 1648195,
      "region": "Asia",
      "subregion": "Southern Asia",
      "world_region": "EMEA",
      "region_code": "142",
      "subregion_code": "034",
      "landlocked": false,
      "borders": [
        "AFG",
        "ARM",
        "AZE",
        "IRQ",
        "PAK",
        "TUR",
        "TKM"
      ],
      "independent": "Yes"
    },
    "dialling": {
      "calling_code": [
        "98"
      ],
      "national_prefix": "0",
      "national_number_lengths": [
        10
      ],
      "national_destination_code_lengths": [
        2
      ],
      "international_prefix": "00"
    },
    "extra": {
      "geonameid": 130758,
      "edgar": 0,
      "itu": "IRN",
      "marc": "ir",
      "wmo": "IR",
      "ds": "IR",
      "fifa": "IRN",
      "fips": "IR",
      "gaul": 117,
      "ioc": "IRI",
      "cowc": "IRN",
      "cown": 630,
      "fao": 102,
      "imf": 429,
      "ar5": "MAF",
      "address_format": null,
      "eu_member": null,
      "vat_rates": null
    },
    "population": {
      "count": 79615300,
      "worldPercentage": 1.07
    },
    "wikiLink": "/wiki/Iran"
  }
}

Languages Data

The Languages data based on ISO 639-3 languages codes.

Data Structure

  • full - language full name
  • speak (optional)
    • isExist - true if language speaker exist
    • optional - another speaker that speak the language
    • speakerGenderRestriction - Male when Female speaker does not exist

Example: Azerbaijani

{
  "aze": {
    "full": "Azerbaijani",
    "speak": {
      "isExist": false
    }
  }
}

Example: Malay

{
  "msa": {
    "full": "Malay",
    "speak": {
      "optional": "eng"
    }
  }
}

Example: Albanian

{
  "alb": {
    "full": "Albanian",
    "speak": {
      "speakerGenderRestriction": "Male"
    }
  }
}

Anthems Data

The country keys is based on iso_3166_1_alpha2 (a2) countries codes.

Data Structure

  • link - full link to audio file
  • source - link source

Example: United States

{ 
  "US": {
    "link": "https://commons.wikimedia.org/wiki/File%3AStar Spangled Banner instrumental.ogg?embedplayer=yes",
    "source": "wikimedia"
  }
}

Initial Data Source

Transformed from countries-data to json format.

The initial json data is part of rinvex country repository.