RepositoryTypeScript
dinerojs

dinerojs/dinero.js

Create, calculate, and format money in JavaScript and TypeScript

6.8kstars
207forks
3issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: currency

#1 Repository of the week

1
TINIX TRENDING·Topic: immutable

#1 Repository of the week

1
TINIX TRENDING·Topic: amount

#1 Repository of the week

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

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
RepositoryTypeScript
vuejs/vue

This is the repo for Vue 2. For Vue 3, go to https://github.com/vuejs/core

212.6k
Oct 10, 2024
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryJavaScript
react/react

The library for web and native user interfaces.

253.0k
Nov 30, 2026
RepositoryJavaScript
trekhleb/javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

196.8k
Jul 26, 2026
Repository
getify/You-Dont-Know-JS

A book series (2 published editions) on the JS language.

184.8k
Oct 31, 2026
RepositoryTypeScript
angular/angular

Deliver web apps with confidence 🚀

101.7k
Dec 1, 2026
RepositoryTypeScript
mermaid-js/mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown

91.3k
Nov 29, 2026