arev

Typed world geography data for JavaScript and TypeScript.

arev packages countries, phone codes, cities, states, currencies, languages, geography data, flags, and SVG map helpers into one reusable library with typed exports and lookup utilities.

Install

npm install arevdata

Quick start

import {
  countries,
  getCountryByCode,
  getCountryFlag,
  phoneCountryCodes,
} from "arevdata";

console.log(countries.length);

const malta = getCountryByCode("MT");
console.log(malta?.name);
console.log(getCountryFlag("MT"));

const pickerOptions = phoneCountryCodes.map((entry) => ({
  value: entry.phoneCode,
  label: `${entry.flag} ${entry.country} (${entry.phoneCode})`,
}));

Live demos

Reference

  • Countries for ISO codes, capitals, continents, currencies, and flag emoji
  • Phone country codes for international dialling selectors and shared prefixes
  • Cities for capitals, coordinates, population, and search helpers
  • States, provinces, and divisions for subnational administrative data
  • Continents and currencies for continent metadata and ISO 4217 currency lookups
  • Languages for language catalogs, locale variants, and official-language mappings
  • Geography for centroids, bounds, neighbours, climate data, and geo-game utilities
  • Flags for SVG and PNG URLs, colour palettes, and similar-flag groups
  • World map for SVG rendering and country highlighting
  • Country maps for standalone country SVG output and map-point helpers

What this library is good at

  • Powering country, language, currency, and phone-code selectors
  • Building geography games and quiz mechanics
  • Looking up capitals, neighbours, climate zones, and map geometry
  • Rendering world maps and country SVGs without another mapping stack