Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dinerojs avatar

Dinero Currency Patterns

  • 11 installs
  • 6.8k repo stars
  • Updated August 1, 2026
  • dinerojs/dinero.js

Handle multi-currency conversion, custom currencies, database storage, and payment integration with Dinero.js.

About

Currency-handling patterns for Dinero.js covering conversion, custom currencies, storage, and payment integration. A developer uses it when working with multiple currencies or storing money in a database.

  • Type-safe custom currencies with as-const satisfies and compile-time mismatch checks
  • Conversion with scaled rates, database storage patterns, and Stripe/PayPal payment integration

Dinero Currency Patterns by the numbers

  • 11 all-time installs (skills.sh)
  • Ranked #798 of 1,106 Finance & Trading skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dinerojs/dinero.js --skill dinero-currency-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs11
repo stars6.8k
Last updatedAugust 1, 2026
Repositorydinerojs/dinero.js

What it does

Handle multi-currency conversion, custom currencies, database storage, and payment integration with Dinero.js.

Files

SKILL.mdMarkdownGitHub ↗

Dinero.js Currency Patterns

Patterns for handling currencies with Dinero.js: type safety, conversions, custom currencies, database storage, and payment service integration.

When to Apply

Reference these guidelines when:

  • Converting between currencies with convert
  • Defining custom currencies (e.g., cryptocurrencies, loyalty points)
  • Looking up currencies dynamically from external input
  • Storing monetary values in a database
  • Integrating with payment services (Stripe, PayPal, Square)

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Type SafetyHIGHtypes-
2ConversionHIGHconvert-
3StorageHIGHstorage-
4Payment IntegrationMEDIUMpayment-

Quick Reference

1. Type Safety (HIGH)

  • types-as-const - Define custom currencies with as const satisfies for compile-time safety
  • types-currency-mismatch - TypeScript catches currency mismatches in operations at compile time
  • types-lookup-validation - Validate currency codes from external sources at runtime

2. Conversion (HIGH)

  • convert-scaled-rates - Use scaled amounts for fractional exchange rates, not floats
  • convert-reusable - Build reusable converter functions with higher-order patterns

3. Storage (HIGH)

  • storage-database - Store amount, currency code, and scale as separate columns
  • storage-no-money-type - Avoid PostgreSQL's money type for multi-currency applications

4. Payment Integration (MEDIUM)

  • payment-services - Map Dinero objects to payment service formats with dedicated helpers

How to Use

Read individual rule files for detailed explanations and code examples:

rules/types-as-const.md
rules/convert-scaled-rates.md

Each rule file contains:

  • Brief explanation of why it matters
  • Incorrect code example with explanation
  • Correct code example with explanation
  • Additional context and references

Related skills

Finance & Tradingfinancepayments

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.