annexare/Countries
annexare/Countries has 1,334 GitHub stars and 425 forks. GitHot measured +2 in 7 days and +1 in 15 days. Last checked 2026-11-13 17:19 UTC. Last push 2026-10-14.
측정된 스타 증가
- in 24h
- 업데이트 지연
- in 7 days
- +2
- in 15 days
- +1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Countries, Languages & Continents data (capital and currency, native name, calling codes).
데이터README.md
OriginalCountries, Languages & Continents data
Continents & countries: ISO 3166-1 alpha-2 code (with alpha-2 to alpha-3 set), name, ISO 639-1 languages, capital, ISO 4217 currencies (with symbols & numeric codes), native name, calling codes. Lists are available in JSON, CSV and SQL formats. Also, contains separate JSON files with additional country Emoji flags data.
Version 3.0: Breaking changes
Version 3 comes with some data structure changes. It was completely reworked under the hood with TypeScript, ESM exports and a Bun workspaces monorepo structure.
Everything is strongly typed so you can easily use data with auto-complete in your IDE.
Note: If your projects depend on the old structure, carefully specify required versions in your dependencies.
Installation
Package is available via:
- Bun
bun add countries-list - NPM
npm install countries-list - Composer / Packagist
composer require annexare/countries-list
Usage (version 3.x)
Module exports continents, countries, languages and utility functions.
// Interfaces and types
import type {
ICountry,
ICountryData,
ILanguage,
TContinentCode,
TCountryCode,
TLanguageCode,
} from 'countries-list'
// Main data and utils
import { continents, countries, languages } from 'countries-list'
// Utils
import { getCountryCode, getCountryData, getCountryDataList, getEmojiFlag } from 'countries-list'
// Minimal data in JSON
import countries2to3 from 'countries-list/minimal/countries.2to3.min.json'
import countries3to2 from 'countries-list/minimal/countries.3to2.min.json'
import languageNames from 'countries-list/minimal/languages.native.min'
getCountryCode('Ukraine') // 'UA'
getCountryCode('Україна') // 'UA'
getCountryData('UA') // ICountryData
Built files are in the dist directory of this repository, and packages/countries directory contains source data.
Note: JS build contains ES modules, CommonJS and IIFE (for now)
- CJS
cjs/index.js - ESM
mjs/index.js - IIFE
index.iife.js
Currencies (ISO 4217)
Full ISO 4217 currency data — English and native name, UI symbol, native symbol, 3-digit numeric code and minor-unit decimals — is an opt-in import via the countries-list/currencies subpath, so it does not affect the main bundle size:
import type { ICurrency, ICurrencyData, TCurrencyCode } from 'countries-list'
import { currencies, getCurrency, getCurrencyByNumeric } from 'countries-list/currencies'
// Minimal maps (code -> value)
import currencySymbols from 'countries-list/minimal/currencies.symbol.min.json'
import currencyNumbers from 'countries-list/minimal/currencies.numeric.min.json'
currencies.UAH // { name: 'Ukrainian Hryvnia', native: 'українська гривня', symbol: '₴', symbolNative: '₴', numeric: '980', decimals: 2 }
getCurrency('JPY') // ICurrencyData: { code: 'JPY', name: 'Japanese Yen', symbol: '¥', decimals: 0, ... }
getCurrencyByNumeric('840') // ICurrencyData for USD — numeric lookup, e.g. for banking
The dataset covers the complete active ISO 4217 list plus a few withdrawn codes still referenced by country data (e.g. ANG, flagged with withdrawn: true). symbol falls back to the ISO code where a currency has no distinct Latin glyph (e.g. CHF, KWD); the local glyph is then in symbolNative. Symbols come from Unicode CLDR (ISO 4217 itself defines no symbols).
Data structure examples
const continents = {
AF: 'Africa',
AN: 'Antarctica',
AS: 'Asia',
EU: 'Europe',
NA: 'North America',
OC: 'Oceania',
SA: 'South America',
}
const countries = {
// ...
UA: {
name: 'Ukraine',
native: 'Україна',
phone: [380],
continent: 'EU',
capital: 'Kyiv',
currency: ['UAH'],
languages: ['uk'],
},
// ...
}
const languages = {
// ...
uk: {
name: 'Ukrainian',
native: 'Українська',
},
ur: {
name: 'Urdu',
native: 'اردو',
rtl: 1,
},
// ...
}
const currencies = {
// ...
UAH: {
name: 'Ukrainian Hryvnia',
native: 'українська гривня',
symbol: '₴',
symbolNative: '₴',
numeric: '980',
decimals: 2,
},
// ...
}
Contributing to this repository
Everything is generated from strongly typed files in packages/countries/src, including SQL file.
Everything in dist is generated,
so please make data related changes ONLY to files from packages/countries, commit them.
Use bun run build / bun run test to build/test generated files.
The currencies dataset (packages/countries/src/data/currencies.ts) is generated from the official ISO 4217 list and Unicode CLDR via packages/scripts/generateCurrencies.ts. Refresh it with cd packages/scripts && bun run generate:currencies (requires network) when ISO 4217 publishes an update, rather than editing the data by hand.
Credits
Prepared by Annexare Studio from different public sources. Feel free to use it as you need in your apps or send updates into this public repository. It's under MIT license.
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,703 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,890 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,493 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,519 스타