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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@desoukysvyc/currency

v0.2.2

Published

[![npm version](https://badge.fury.io/js/%40desoukysvyc%2Fcurrencies.svg)](https://www.npmjs.com/package/@desoukysvyc/currencies) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Downloads

27

Readme

@desoukysvyc/currencies

npm version License

A specialized sub-package for accessing currency-related information, including currency codes, details, and more.

Installation

You can install this package using npm:

npm install @desoukysvyc/currencies

Usage

Querying Currencies

The package provides a convenient query method for filtering currencies based on various criteria. Examples:

Find details about Currency By Code

import { currencies } from "@desoukysvyc/currencies";

const euroDetails = currencies.query({ code: "EUR" });

/* Output
    [ 
        { code: 'EUR', decimal: 2, name: 'Euro', num: '978', symbol: '€' }
    ]
*/

Find currencies with a specific decimal value

import { currencies } from "@desoukysvyc/currencies";

const decimalCurrencies = currencies.query({ decimal: 2 });

/* Output

[
  {
    code: 'AED',
    decimal: 2,
    name: 'United Arab Emirates dirham',
    num: '784',
    symbol: 'د.إ'
  },
  {
    code: 'AFN',
    decimal: 2,
    name: 'Afghan afghani',
    num: '971',
    symbol: '؋'
  },
  {
    code: 'ALL',
    decimal: 2,
    name: 'Albanian lek',
    num: '008',
    symbol: 'L'
  },
  {
    code: 'AMD',
    decimal: 2,
    name: 'Armenian dram',
    num: '051',
    symbol: '֏'
  }
  ... 136 more items
]
 */

Find currencies with a specific symbol

import { currencies } from "@desoukysvyc/currencies";

const currencyWithSymbol = currencies.query({ symbol: "$" });

/* Output

[
  {
    code: 'ARS',
    decimal: 2,
    name: 'Argentine peso',
    num: '032',
    symbol: '$'
  },
  {
    code: 'AUD',
    decimal: 2,
    name: 'Australian dollar',
    num: '036',
    symbol: '$'
  },
  {
    code: 'BBD',
    decimal: 2,
    name: 'Barbados dollar',
    num: '052',
    symbol: '$'
  },
  {
    code: 'BMD',
    decimal: 2,
    name: 'Bermudian dollar',
    num: '060',
    symbol: '$'
  }
  ... 136 more items
]
 */

Typescript Support

Currency

type Currency = {
  code: CurrencyCode;
  decimal?: number;
  name: string;
  num: CurrencyNum;
  symbol: string;
};

type CurrencyCode = "ALL" | "DZD" | "USD" | "EUR" | "AOA" | "XCD" | "ARS" | "AMD" | "AWG" | "AUD" | "AZN" | "BHD" | "GBP" | "BDT" | "BBD" | "BYN" | "BZD" | "XOF" | "BMD" | "BTN" | "INR" | "BOB" | "BOV" | ... 156 more ... | "XXX"

type CurrencyNum = "008" | "012" | "032" | "051" | "533" | "036" | "048" | "050" | "052" | "084" | "060" | "064" | "068" | "072" | "096" | "108" | "116" | "124" | "132" | "136" | "152" | "156" | "170" | ... 156 more ... | "932"