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.
It now also includes a lightweight astronomy layer for moon phases and hemisphere-aware seasons.
The hosted API is intentionally rate-limited. For unlimited access to the datasets, use the npm package directly.
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
- API Reference for the hosted HTTP endpoints, query parameters, and response examples
- Data & Assets for countries, cities, states, languages, currencies, phone codes, and flags
- Geography & Maps for geography records, geo utilities, world maps, and country maps
- Astronomy & Time for moon phases and hemisphere-aware season data
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
Package links
- Repository: https://github.com/silvandiepen/arev
- Docs site output: generated from this
docs/folder withgirk - API base: https://api.arevdata.com