Iso LocaleIntroduction

Introduction

ISO standards data for countries, currencies, regions, timezones, and BCP 47 locale support

Last updated:

@visulima/iso-locale

Comprehensive ISO standards data for countries (ISO 3166), currencies (ISO 4217), regions (UN Geoscheme), timezones (IANA), and BCP 47 locale support.

Key Features

  • Country Data - ISO 3166-1 alpha-2/alpha-3 codes, flag emojis, calling codes
  • Currency Data - ISO 4217 codes, symbols, country mappings
  • Region Data - UN Geoscheme continents and subregions
  • Timezone Data - IANA timezone database with country mappings
  • BCP 47 Support - Parse and generate language tags
  • TypeScript - Full type definitions

Quick Start

import { getByAlpha2, getEmoji, getCurrency } from "@visulima/iso-locale";

const country = getByAlpha2("US");
console.log(country.name); // "United States"
console.log(getEmoji("US")); // "🇺🇸"
console.log(getCurrency("en-US")); // "USD"

Use Cases

// Country selector
import { getAllCountries, getEmoji } from "@visulima/iso-locale";

const countries = getAllCountries().map(c => ({
    code: c.alpha2,
    name: c.name,
    flag: getEmoji(c.alpha2)
}));

// Currency formatting
import { getSymbol } from "@visulima/iso-locale";

function formatPrice(amount: number, code: string) {
    return `${getSymbol(code)}${amount.toFixed(2)}`;
}

Next Steps

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues