New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@tumbati/countries-metadata

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tumbati/countries-metadata

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

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

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.

Installation

npm:

npm install @tumbati/countries-metadata

pnpm:

pnpm add @tumbati/countries-metadata

yarn:

yarn add @tumbati/countries-metadata

Usage

Import the package

import { countries, type Country, findCountryByCode, getCountryByName, findCountriesByContinent } from "@tumbati/countries-metadata";

Access all countries

An array containing metadata about various countries.

import { countries, type Country } from "@tumbati/countries-metadata";

console.log(countries); // Array of all countries

Find a country by its code

import { findCountryByCode } from "@tumbati/countries-metadata";

const country = findCountryByCode('MW');
console.log(country); // { code: 'MW', name: 'Malawi', ... }

Get a country by its name

import { getCountryByName } from "@tumbati/countries-metadata";

const country = getCountryByName('Malawi');
console.log(country); // { code: 'MW', name: 'Malawi', ... }

Find countries in a specific continent

import { findCountriesByContinent } from "@tumbati/countries-metadata";

const africanCountries = findCountriesByContinent('Africa');
console.log(africanCountries); // Array of all African countries

TypeScript Support

The package includes full TypeScript support with type definitions:

import { type Country } from "@tumbati/countries-metadata";

const myCountry: Country = {
    code: 'US',
    flag: '🇺🇸',
    name: 'United States',
    dial_code: '+1',
    currency_code: 'USD',
    continent: 'North America',
    capital: 'Washington, D.C.'
};

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.

Keywords

Countries

FAQs

Package last updated on 06 Oct 2025

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