
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
@coingecko/cryptoformat
Advanced tools
cryptoformat is used by CoinGecko (https://www.coingecko.com) to format crypto and fiat values.
Often an altcoin can be worth much less than $0.01 USD, and thus we need to format this value by providing more decimal places in the formatting to prevent losing precious information.
cryptoformat also tries to handle different locales and currency formatting by deferring the work to the browser's Intl.NumberFormat. If Intl.NumberFormat is not supported by the browser, cryptoformat provides a primitive fallback for currency display.
npm i @coingecko/cryptoformat
import { formatCurrency } from "@coingecko/cryptoformat";
formatCurrency(123, "USD", "en");
// "$123.00"
formatCurrency(0.00123, "USD", "en");
// "$0.00123000"
// Provide raw = true to remove formatting and symbol
formatCurrency(0.00123, "USD", "en", true);
// "0.00123000"
formatCurrency(123400, "IDR", "id");
// "Rp123.400"
formatCurrency(123400, "EUR", "de");
// "123.400 €"
cryptoformat tries to cache formatters for reuse internally. If same locale and currency is used, the cached formatter will be used.
Intl.NumberFormat does not always behave consistently across browsers. cryptoformat does some manual overrides in order to ensure that "MYR123.00" is displayed as "RM123.00", for example.cryptoformat does not try to do country sniffing. It is the responsibility of the caller to provide that if possible, but providing only "en" should also work for the most part, but not perfectly: users in different regions may expect a different formatting for the same language.npm run build && npm run submit
|- lib
|- index.js (Build with babel)
|- src
- index.js (Main Code)
- index.d.ts (Types for TypeScript)
- test.js (Test with Jest)
FAQs
Javascript library to format and display cryptocurrencies and fiat
The npm package @coingecko/cryptoformat receives a total of 1,987 weekly downloads. As such, @coingecko/cryptoformat popularity was classified as popular.
We found that @coingecko/cryptoformat demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.