@worldkit/data
v1.0.3
Published
Compressed and normalized global datasets for @worldkit
Downloads
837
Maintainers
Readme
📦 @worldkit/data
Core compiled immutable global datasets for WorldKit packages.
Ultra-compact, pre-compiled immutable JSON datasets for countries, currencies, cities, states, timezones, and languages.
📚 Full Documentation: https://worldkit.in/docs/data
⚡ Features
- ⚡ Zero-Copy Memory Layout: Optimally packed compact JSON structures for minimal RAM allocation.
- 📦 Tree-Shakeable ESM: Import only the datasets your application needs.
- 🔒 Immutable Arrays: Frozen data structures prevent runtime dataset mutations.
- 🌐 100% Edge Compatible: Cloudflare Workers, Vercel Edge, Deno, Bun, and Node.js.
📦 Install
npm install @worldkit/data
# or
pnpm add @worldkit/data
# or
yarn add @worldkit/data💡 Usage
import {
COMPACT_COUNTRIES,
CURRENCIES_LIST,
CITIES_LIST,
STATES_LIST,
TIMEZONES_LIST,
LANGUAGES_LIST,
CONTINENTS
} from "@worldkit/data";
console.log(`Loaded ${COMPACT_COUNTRIES.length} countries`);
console.log(`Loaded ${CURRENCIES_LIST.length} currencies`);
console.log(`Loaded ${CITIES_LIST.length} world cities`);
console.log(`Loaded ${STATES_LIST.length} states/provinces`);📖 API Reference
Exported constant arrays:
COMPACT_COUNTRIES: Compressed country metadata tuple arrays.CURRENCIES_LIST: Array of ISO-4217 currency data objects.CITIES_LIST: Major world cities array with coordinates (lat/lng).STATES_LIST: Array of 4,000+ states and provinces.TIMEZONES_LIST: List of 400+ IANA timezones and UTC offsets.LANGUAGES_LIST: Array of ISO 639-1 language objects.CONTINENTS: Continent code lookup mapping.
📐 TypeScript Support
Includes strict TypeScript types for all dataset items:
import type {
CompactCountry,
CurrencyData,
CityData,
StateData,
TimezoneData,
LanguageData
} from "@worldkit/data";🔗 Related Packages
Explore the rest of the WorldKit ecosystem:
@worldkit/core- Main JavaScript/TypeScript API facade.@worldkit/countries- High-level country lookups.@worldkit/currencies- High-level currency lookups.
📜 License
MIT © WorldKit
