2.0.0-alpha.9 • Published 3 years ago
@pesos/dinero.js v2.0.0-alpha.9
@pesos/dinero.js
Create, calculate, and format money in JavaScript and TypeScript
This package exports Dinero.js. It works out of the box with number
types, but you can adapt it for custom types or third-party libraries by implementing a custom calculator.
📦 Install
npm install @pesos/dinero.js@alpha
# or
yarn add @pesos/dinero.js@alpha
⚡️ Quick start
Dinero
objects are minimal. Every function in @pesos/dinero.js
is side-effect free, allowing you only to bundle exactly what you use.
import { USD } from '@pesos/core';
import { dinero, add } from '@pesos/dinero.js';
const d1 = dinero({ amount: 500, currency: USD });
const d2 = dinero({ amount: 800, currency: USD });
add(d1, d2);
📚 Documentation
For full documentation, visit the online documentation.
2.0.0-alpha.9
3 years ago