dinerojs/dinero.js
소개
JavaScript와 TypeScript에서 금액을 생성하고 계산하며 형식을 지정합니다
기타 프로젝트What you can do
- 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
측정된 스타 증가
- in 24h
- +1
- in 7 days
- +5
- in 15 days
- +3
- in 1 month
- +10
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
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
numberby default orbigintfor 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.
👥 Contributors
📜 License
관련 프로젝트 살펴보기
불러오는 중…