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

@finket/finketcurrencies

v1.0.0

Published

finket currency code library from ISO 4217

Downloads

15

Readme

@finket/finketcurrencies

A lightweight Node.js library for retrieving ISO 4217 currency data.
Provides intuitive methods to access currency details by their alphabetic code ("USD", "ARS") or numeric code ("840", "032").
Perfect for financial applications, internationalization, and currency-related tasks.

Features

  • Access currency info: code, number, name, minor unit exponent, countries.
  • Search by ISO 4217 alphabetic or numeric codes (case-insensitive).
  • Minimal dependencies for lightweight footprint.
  • Robust input validation.
  • Easy integration into Node.js projects.

Installation

npm install @finket/finketcurrencies

For private registries (e.g., AWS CodeArtifact), configure your .npmrc or authenticate before installing. See Private Registry.

Usage

The library offers two main methods: findByCode and findByNumber.
You can retrieve full details for any ISO 4217 currency.

Example 1: Finding Currencies by Alphabetic Code

const { findByCode } = require("@finket/finketcurrencies");

// Find USD
const usd = findByCode("USD");
console.log(usd);

// Find ARS
const ars = findByCode("ARS");
console.log(ars);

Expected Output:

{
  "code": "USD",
  "number": "840",
  "name": "US Dollar",
  "exponent": 2,
  "countries": ["UNITED STATES"]
}
{
  "code": "ARS",
  "number": "032",
  "name": "Argentine Peso",
  "exponent": 2,
  "countries": ["ARGENTINA"]
}

Example 2: Finding Currencies by Numeric Code

const { findByNumber } = require("@finket/finketcurrencies");

// Find by numeric code
const usd = findByNumber("840");
const ars = findByNumber(32); // numeric input also allowed

console.log(usd);
console.log(ars);

Example 3: Processing Multiple Currencies

const { findByCode } = require("@finket/finketcurrencies");

const codes = ["USD", "ARS", "EUR"];
codes.forEach(code => {
  const currency = findByCode(code);
  if (currency) {
    console.log(`${currency.name} (${currency.code}): ${currency.countries.join(", ")}`);
  } else {
    console.log(`Currency not found: ${code}`);
  }
});

Expected Output (partial):

US Dollar (USD): UNITED STATES
Argentine Peso (ARS): ARGENTINA
Euro (EUR): ÅLAND ISLANDS, EUROPEAN UNION, ...

API Reference

findByCode(code)

Retrieves a currency by its ISO 4217 alphabetic code.

  • Parameters:
    code (string): Alphabetic code (e.g., "USD"). Case-insensitive.
  • Returns:
    A currency object or null if not found.
  • Throws:
    Error if code is not a valid non-empty string.

findByNumber(number)

Retrieves a currency by its ISO 4217 numeric code.

  • Parameters:
    number (string | number): Numeric code (e.g., "840" or 840).
  • Returns:
    A currency object or null if not found.
  • Throws:
    Error if number is not provided.

Currency Object Structure

Each currency object contains:

| Field | Type | Example | |-----------|----------|-------------| | code | string | "USD" | | number | string | "840" | | name | string | "US Dollar" | | exponent | number | 2 | | countries | string[] | ["UNITED STATES"] |


Requirements

  • Node.js v14 or higher
  • Dependency: csv-parse (^5.5.6)

Private Registry

If you're using a private registry like AWS CodeArtifact:

aws codeartifact login --tool npm --domain finket --domain-owner 194122164712 --repository finket --region us-east-1
npm install @finket/finketcurrencies

Contact your registry administrator for more details.

Contributing

Contributions are welcome! 🚀

  1. Fork the repo.
  2. Create your branch: git checkout -b feature/your-feature
  3. Commit your changes: git commit -m "Add feature"
  4. Push to the branch: git push origin feature/your-feature
  5. Open a pull request.

Please ensure your code includes tests and follows project standards.

Issues

Report bugs or request features by opening an issue.

License

This project is licensed under the MIT License.
See the LICENSE file for details.

Acknowledgments

  • Currency data based on ISO 4217 official standard.
  • CSV parsing powered by the csv-parse library.