TypeScript
/infobits-intl

Getting Started

Getting Started

infobits-intl provides comprehensive internationalization data including countries, languages, currencies, and continents. Each entity comes with ISO-standard codes, metadata, SVG country flags, and translations in multiple languages.

What's Included

  • 248+ countries with ISO 3166-1 alpha-2/alpha-3 codes, capitals, calling codes, TLDs, and more
  • 185+ languages with ISO 639-1 codes, native names, and dialects
  • 179+ currencies with ISO 4217 codes, symbols, and plural forms
  • 7 continents with country groupings
  • SVG country flags embedded as strings
  • Translations for all entities in 7 locales: Danish, German, English, Spanish, French, Italian, and Chinese

Installation

GoDartTypeScript
npm install infobits-intl

Quick Example

Look up a country and print its details:

GoDartTypeScript
import { getCountryByAlpha2 } from 'infobits-intl';

const country = getCountryByAlpha2('US');
if (country) {
  console.log(country.nativeName);  // United States
  console.log(country.alpha3Code);  // USA
  console.log(country.capital);     // Washington, D.C.
}

Type-Safe Code Constants

Each package provides typed constants for country, language, currency, and continent codes, enabling autocompletion and compile-time safety.

GoDartTypeScript
import { CountryCode, countries } from 'infobits-intl';

const usa = countries[CountryCode.US];
console.log(usa.nativeName); // United States