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

@lacspace/currency

v1.0.0

Published

ISO 4217 currencies — codes, numeric codes, minor units, names, symbols and the countries that use them, plus Intl-free formatting. Zero-dependency, isomorphic.

Readme

@lacspace/currency

ISO 4217, with the minor units right. Codes, numeric codes, minor units (0 for JPY, 3 for BHD, 4 for CLF), names, symbols, and a formatter that gives the same answer on every runtime. Zero dependencies, isomorphic, fully typed.

npm i @lacspace/currency
import { currency, minorUnits, toMinor, formatCurrency, currencies } from "@lacspace/currency";

currency("npr");                               // { code: "NPR", numeric: "524", minorUnits: 2, name: "Nepalese Rupee", symbol: "रू", kind: "currency" }
minorUnits("JPY");                             // 0
toMinor(19.99, "USD");                         // 1999  — rounds the decimal you wrote, so toMinor(1.005, "USD") is 101
formatCurrency(1234.5, "USD");                 // "$1,234.50"
formatCurrency(1234.5, "EUR", { locale: "de" }); // "1.234,50 €"
formatCurrency(1234567.89, "INR", { locale: "in" }); // "₹12,34,567.89"
currencies({ special: false, funds: false });  // money in circulation only

API

| Function | Notes | |---|---| | currency(code \| numeric) | Any case; undefined when unknown | | currencies({ special?, funds? }) | All codes; special: false drops metals/bond units/test codes, funds: false drops fund codes (CLF, MXV, USN …) | | isCurrencyCode(x) · currencyName · currencySymbol | Helpers | | minorUnits(code) | 0 / 2 / 3 / 4 per ISO; unknown codes default to 2 | | toMinor(major, code) · fromMinor(minor, code) | Integer minor units, float-safe | | formatCurrency(amount, code, { locale, display, decimals }) | Locales en de fr ch in; display: symbol / code / none | | FUND_CODES | The ISO fund codes |

How it was checked

Every code is cross-checked against ICU's currency list and names, and the minor-unit column is asserted to match the ISO 4217 list exactly: 0 for BIF CLP DJF GNF ISK JPY KMF KRW PYG RWF UGX UYI VND VUV XAF XOF XPF, 3 for BHD IQD JOD KWD LYD OMR TND, 4 for CLF UYW, 2 for everything else. ICU's own rounding is cash rounding (it rounds AFN, IDR and COP to 0) and is deliberately not used. ANG is not listed: the Caribbean guilder XCG replaced it in 2025.

The Lacspace Developer Platform

This package is part of the Lacspace developer platform: 150+ zero-dependency packages, one CLI, real docs. Browse the Global Data Kit or every package at developer.lacspace.com/packages.

Licence

Free under the Lacspace Free Licence v1.0.