npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@amali-tech/country-locale-api

v1.0.2

Published

Library of countries with locale and currency information

Readme

@amali-tech/country-locale-api

Country, currency, number, and date helpers for ERP applications.

This package gives product teams a small typed API for common locale workflows:

  • Country dropdown options: [{ key: "US", label: "United States" }]
  • Currency dropdown options: [{ key: "$", label: "USD" }]
  • Country lookup by name, ISO code, or supported alias
  • Currency, number, and date formatting by BCP 47 locale

Installation

pnpm add @amali-tech/country-locale-api
npm install @amali-tech/country-locale-api

Node.js 22 or newer is required.

Usage

import {
  countryOptions,
  currencyOptions,
  formatCurrency,
  formatDate,
  formatNumber,
  getCountryInfo,
} from '@amali-tech/country-locale-api';

countryOptions;
// [{ key: "GH", label: "Ghana" }, { key: "US", label: "United States" }, ...]

currencyOptions;
// [{ key: "$", label: "USD" }, ...]

getCountryInfo('USA');
// Full country metadata for the United States

formatCurrency(1234.56, 'en-US');
// "$1,234.56"

formatNumber(1234567.89, 'de-DE');
// "1.234.567,89"

formatDate(new Date(2025, 2, 15), 'en-GB');
// "15/03/2025"

API

countries

Readonly country metadata suitable for ERP configuration screens, address forms, and locale-aware defaults. Each country includes ISO code, display name, locale, phone code, currency, date/time patterns, number separators, and timezone data where available.

countryOptions

Pre-built select options derived from countries.

type LocaleOption = {
  key: string;
  label: string;
};

key is the ISO 3166-1 alpha-2 country code. label is the country name.

currencyOptions

Pre-built select options derived from unique currencies in countries.

key is the currency symbol. label is the ISO 4217 currency code.

getCountryInfo(countryName)

Looks up country metadata by:

  • Country name, such as "Ghana"
  • ISO country code, such as "GH"
  • Supported alias, such as "USA"

The lookup is case-insensitive and trims whitespace. Unknown values return undefined.

formatCurrency(amount, locale)

Formats a finite number with Intl.NumberFormat and infers the currency from the locale's country/region where available. Unsupported countries fall back to USD.

formatNumber(value, locale)

Formats a finite number with Intl.NumberFormat.

formatDate(date, locale)

Formats a Date, ISO-8601 string, or millisecond timestamp using the date pattern configured for the locale's country. Unknown countries fall back to dd/MM/yyyy.

Development

corepack enable
pnpm install
pnpm lint
pnpm typecheck
pnpm build
pnpm test

Releasing

Releases are automated with Changesets and GitHub Actions. Add a changeset for public API or runtime behavior changes:

pnpm changeset

Merges to main create a version PR. When that PR is merged, the release workflow publishes to npm with provenance.

License

Apache-2.0. Copyright AmaliTech.