Retour au classement

dinerojs/dinero.js

TypeScriptdinerojs.com

Create, calculate, and format money in JavaScript and TypeScript

moneymonetaryamountimmutablecurrencyjavascripttypescript
Croissance des étoiles
Étoiles
6.8k
Forks
202
Croissance hebdomadaire
Issues
1
2k4k6k
mars 2018déc. 2020oct. 2023juil. 2026
Artefactsnpmnpm install dinero.js
README

Dinero.js

npm version npm monthly downloads Used by GitHub stars
TypeScript GitHub Actions NPM

Dinero.js lets you create, calculate, and format money safely in JavaScript and TypeScript.
dinerojs.com


Money is complex, and the primitives of the language aren't enough to properly represent it. Dinero.js is a JavaScript library that lets you express monetary values, but also perform mutations, conversions, comparisons, formatting, and overall make money manipulation easier and safer in your application.

✨ Features

  • Immutable & pure: every operation returns a new object, no side effects
  • Type-safe: first-class TypeScript support with full type inference
  • Tree-shakeable: import only what you use, keep bundles small
  • Pluggable precision: use number by default or bigint for large amounts
  • Non-decimal currencies: support for any base, including multi-subdivision currencies
  • Framework-agnostic: works everywhere JavaScript runs

📦 Install

npm install dinero.js

# or

yarn add dinero.js

⚡️ Quick start

Dinero objects are minimal. Every function in dinero.js is side-effect free, allowing you only to bundle exactly what you use.

import { dinero, add, toDecimal } from 'dinero.js';
import { USD } from 'dinero.js/currencies';

const d1 = dinero({ amount: 500, currency: USD });
const d2 = dinero({ amount: 800, currency: USD });

const total = add(d1, d2);

toDecimal(total); // "13.00"

Check out the quick start guide on the documentation.

📚 Documentation

The documentation lets you learn about all aspects of the library.

  • Getting started to get up and running quickly with Dinero.js
  • Core concepts to learn about the underlying principles behind the library
  • Guides to dig deeper into specific use cases.
  • API for a comprehensive list of available functions and their parameters.
  • FAQ for common answers to questions you might have

Visit the full documentation to know more.

🤖 Agent Skills

If you use AI coding agents (Claude Code, Cursor, GitHub Copilot, etc.), install the Dinero.js skills to teach your agent best practices, common pitfalls, and correct usage patterns.

npx skills add dinerojs/skills

🏢 Used by

Dinero.js is used by WooCommerce, Highlight, Cypress, Vercel, AWS Labs, Module Federation, and many more.

Used by

👥 Contributors

Dinero.js contributors

From v1: Sarah Dayan Yacine Hmito Scott Trinh Rolandas Barysas Luiz Bills Leonardo Dino Roman Komarov Juan Garcia Freddy Robinson Andy Burke Andre Wiggins David DeSandro Max Körlinge Ilia Ermolin Kevin Brown Sean Walker John Nguyen Sudarsan Balaji

📜 License

MIT

Dépôts similaires
FujiwaraChoki/MoneyPrinterV2

Automate the process of making money online.

PythonPyPIGNU Affero General Public License v3.0automationcli
31.3k3.4k
actualbudget/actual

A local-first personal finance app

TypeScriptnpmMIT Licensebudgetingfinance
actualbudget.org
27.7k2.7k
firefly-iii/firefly-iii

Firefly III: a personal finances manager

PHPPackagistGNU Affero General Public License v3.0phpmoney
firefly-iii.org
24.1k2.2k
akaunting/akaunting

Online Accounting Software

PHPPackagistOtherphplaravel
akaunting.com
10k2.9k
nayafia/lemonade-stand

A handy guide to financial support for open source

Creative Commons Zero v1.0 Universalmoneysponsorships
7.7k354
shopspring/decimal

Arbitrary-precision fixed-point decimal numbers in Go

GoGo ModulesOthergodecimals
7.5k673
mayswind/ezbookkeeping

A lightweight, self-hosted personal finance app with a user-friendly interface and powerful bookkeeping features.

GoGo ModulesMIT Licenseself-hostedgolang
ezbookkeeping.mayswind.net
5.3k607
deepanshu1422/List-Of-Open-Source-Internships-Programs

A curated list of all the open-source internships/Programs

hacktoberfesthacktoberfest2020
30dayscoding.com
5.1k682
moneyphp/money

PHP implementation of Fowler's Money pattern.

PHPPackagistMIT Licensephpmoney
moneyphp.org
4.9k445
scurker/currency.js

A javascript library for handling currencies

JavaScriptnpmMIT Licensecurrency-valuesjavascript
currency.js.org
3.4k145
RubyMoney/money

A Ruby Library for dealing with money and currency conversion.

RubyRubyGemsMIT Licensemoneyexchange-rate
rubymoney.github.io/money
2.9k642
brndnmtthws/thetagang

ThetaGang is an IBKR bot for collecting money

PythonPyPIGNU Affero General Public License v3.0moneythetagang
2.7k386