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-list-es5

v2.2.4

Published

Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital and currency, native name, calling codes. Available in JSON, CSV and SQL formats.

Downloads

19

Readme

Countries, Languages & Continents data - es5 compatible version

Monthly Downloads NPM Packagist Twitter

Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital and currency, native name, calling codes. Lists are available in JSON, CSV and SQL formats. Also, contains separate JSON files with additional country Emoji flags data.

Version 2.0: Breaking changes

This version changes a lot in the data structures, and placement of the files. So, if your projects depend on the old structure — specify previous versions, <2.0.0.

Installation

Package is available via:

  • NPM npm install countries-list
  • Composer / Packagist composer require tranvansang/countries-list
  • Bower bower install countries

Usage

Module exports continents, countries, languages, languagesAll and functions:

  • getEmojiFlag(countryCode), where countryCode is alpha-2 String
  • getUnicode(emoji), where emoji is alpha-2 emoji flag String

Built files are in the ./dist directory. The ./data directory contains source data.

The consistent data is available from ./dist/data.* files (JSON, SQL).

Note: ES5 UMD build is here: ./dist/index.es5.min.js.

Note: Country item languages field is an Array in JSON files to easily count and match items with a Language item. But currency and phone calling codes may be a comma-separated String.

Note: Languages list only contains languages used in Countries data. Full list of known languages is exported as languagesAll from ./dist/languages.all.json.

Data example

{
  "continents": {
    "AF": "Africa",
    "AN": "Antarctica",
    "AS": "Asia",
    "EU": "Europe",
    "NA": "North America",
    "OC": "Oceania",
    "SA": "South America"
  },
  "countries": {
    "AE": {
      "name": "United Arab Emirates",
      "native": "دولة الإمارات العربية المتحدة",
      "phone": "971",
      "continent": "AS",
      "capital": "Abu Dhabi",
      "currency": "AED",
      "languages": [
        "ar"
      ],
      "emoji": "🇦🇪",
      "emojiU": "U+1F1E6 U+1F1EA"
    },
    ...
    "UA": {
      "name": "Ukraine",
      "native": "Україна",
      "phone": "380",
      "continent": "EU",
      "capital": "Kyiv",
      "currency": "UAH",
      "languages": [
        "uk"
      ],
      "emoji": "🇺🇦",
      "emojiU": "U+1F1FA U+1F1E6"
    }
  },
  "languages": {
    "ar": {
      "name": "Arabic",
      "native": "العربية",
      "rtl": 1
    },
    ...
    "uk": {
      "name": "Ukrainian",
      "native": "Українська"
    }
  }
}

Contributing

Everything is generated from files in ./data, including SQL file.

Everything in ./dist is generated, so please make data related changes ONLY to files from ./data and then run gulp default command to commit generated files as well.

Credits

Prepared by Annexare Studio from different public sources. Feel free to use it as you need in your apps or send updates into this public repository. It's under MIT license.