Dinero.js

Create, calculate, and format money in JavaScript and TypeScript.
GitHub
6.32k
Created 7 years ago, last commit 2 years ago
16 contributors
889 commits
Stars added on GitHub, month by month
12
1
2
3
4
5
6
7
8
9
10
11
2023
2024
Stars added on GitHub, per day, on average
Yesterday
=
Last week
+0.4
/day
Last month
+0.4
/day
Last 12 months
+0.6
/day
npmPackage on NPM
Monthly downloads on NPM
12
1
2
3
4
5
6
7
8
9
10
11
2023
2024
No dependencies
README

Dinero.js

Stability: alpha CircleCI NPM

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


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.

ℹ️ Dinero.js v2 is currently in alpha. For v1, check the v1 branch and docs.

📦 Install

npm install dinero.js@alpha

# or

yarn add dinero.js@alpha

⚡️ 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 { USD } from '@dinero.js/currencies';
import { dinero, add } from 'dinero.js';

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

add(d1, d2);

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.

👥 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


Powered by Vercel