0.0.3 • Published 5 months ago

countries_metadata v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

countries_metadata

List of countries containing country code, currency, dial code, continent, capital, and flags.

Purpose

The purpose of this repository is to provide a detailed list of country metadata, encompassing essential information for each country. The metadata includes:

  • Country code: A unique code assigned to each country.
  • Flag emoji: Emoji representation of the country's flag.
  • Country name: The name of the country.
  • Dial code: The international dialing code for the country.
  • Currency code: The code representing the country's currency.
  • Continent: The continent to which the country belongs.
  • Capital: The capital city of the country.

This data is stored in countries_metadata.json and can be utilized in various applications that require country-related information.

Usage

In your nodejs project:

An array containing metadata about various countries.

import * as metadata from 'countries_metadata'

console.log(metadata.countries)

Find a country by its code.

findCountryByCode(code: string): Country | undefined
import * as metadata from 'countries_metadata'

const country = metadata.findCountryByCode('MW')

Get a country by its name.

getCountryByName(name: string): Country | undefined
import * as metadata from 'countries_metadata'

const country = metadata.findCountryByCode('Malawi')

Find countries in a specific continent.

findCountriesByContinent(continent: string): Country[]
import * as metadata from 'countries_metadata'

const country = metadata.findCountriesByContinent('Africa')

To use the country metadata in your other projects:

  1. Copy or download the countries_metadata.json file from this repository.
  2. Incorporate the data into your application or project as needed.

Data Sources

The country data, including continent and capital information, was sourced from this Gist by tiagodealmeida. The original data was enriched by integrating additional details like dial codes and currency codes.

The flag emojis used in the metadata were sourced from the country-flag-emoji-json repository by Risan.

How the Data was Generated

The countries_metadata.json file was generated by processing data from the country-flag-emoji-json repository and augmenting it with information sourced from tiagodealmeida's Gist. This resulted in a comprehensive dataset containing various details for each country.

Contributing

If you have additional information or updates to the country metadata, feel free to contribute to this repository by submitting a pull request.

License

This repository is licensed under the MIT License.