@lacspace/money 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,12 +5,21 @@
|
|
|
5
5
|
**Money without the floating-point bugs — integer cents, safe math, localized formatting.**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@lacspace/money)
|
|
8
|
+
[](https://bundlephobia.com/package/@lacspace/money)
|
|
9
|
+
[](https://www.npmjs.com/package/@lacspace/money)
|
|
8
10
|
[](https://github.com/lacspace/npm-packages/blob/main/LICENSE)
|
|
9
11
|
|
|
10
12
|
</div>
|
|
11
13
|
|
|
12
14
|
> `0.1 + 0.2 !== 0.3` — so never store money as a float. `@lacspace/money` keeps amounts as **integer minor units**, refuses to add different currencies, splits a bill without losing a cent, and formats with `Intl`. Tiny, typed, isomorphic.
|
|
13
15
|
|
|
16
|
+
- 🪙 **Integer minor units** — no floating-point cent bugs, ever
|
|
17
|
+
- 🧮 Currency-checked arithmetic — adding `USD` to `EUR` throws
|
|
18
|
+
- ➗ `allocate` / `split` distribute without losing a cent (remainder-preserving)
|
|
19
|
+
- 🌍 Localized `Intl` formatting · zero-decimal (JPY) & 3-decimal (BHD) currencies handled
|
|
20
|
+
- 🧊 Immutable — every operation returns a new `Money`
|
|
21
|
+
- ⚡ Zero dependencies · 🌍 isomorphic · 📦 ESM + CJS · fully typed
|
|
22
|
+
|
|
14
23
|
## Install
|
|
15
24
|
|
|
16
25
|
```bash
|
|
@@ -66,16 +75,22 @@ All operations return a new `Money` — instances are immutable.
|
|
|
66
75
|
|
|
67
76
|
## Licensing
|
|
68
77
|
|
|
69
|
-
Free under the **[Lacspace Free Licence](https://lacspace.com/licenses/lacspace-free-1.0)** —
|
|
78
|
+
Free under the **[Lacspace Free Licence](https://developer.lacspace.com/licenses/lacspace-free-1.0)** — permissive freedoms. Use it in personal and commercial projects at no cost; just keep the notice. See the **[Lacspace Licence Centre](https://lacspace.com/licenses)**.
|
|
79
|
+
|
|
80
|
+
<!-- LACSPACE-DEV-PLATFORM -->
|
|
70
81
|
|
|
71
82
|
---
|
|
72
83
|
|
|
73
|
-
|
|
84
|
+
## The Lacspace Developer Platform
|
|
74
85
|
|
|
75
|
-
|
|
86
|
+
`@lacspace/money` is part of **80+ zero-dependency, isomorphic TypeScript packages** — one standard library for the modern web. Explore the ecosystem:
|
|
76
87
|
|
|
77
|
-
|
|
88
|
+
- 📦 **This package, documented** — https://developer.lacspace.com/packages/money
|
|
89
|
+
- 🗂️ **All 80+ packages** — https://developer.lacspace.com/packages
|
|
90
|
+
- 🧭 **Developer handbook** — guides & runnable recipes — https://developer.lacspace.com/handbook
|
|
91
|
+
- 🧪 **Live playground** — run any package in your browser — https://developer.lacspace.com/playground
|
|
92
|
+
- 🖥️ **Finished app templates** — https://templates.lacspace.com
|
|
93
|
+
- 🚀 **Scaffold a full app** — `npm create lacspace-app@latest`
|
|
78
94
|
|
|
79
|
-
|
|
95
|
+
Free under the **[Lacspace Free Licence](https://developer.lacspace.com/licenses/lacspace-free-1.0)** — a permissive, free-to-use licence.
|
|
80
96
|
|
|
81
|
-
<div align="center"><sub>Built with care by <a href="https://lacspace.com">Lacspace</a> · Lacspace Free Licence · <a href="https://github.com/lacspace/npm-packages">source</a></sub></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lacspace/money",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Money done right — integer minor units (no floating-point cent bugs), currency-safe arithmetic, remainder-preserving allocation/split, and localized formatting via Intl. Zero-dependency, isomorphic.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
],
|
|
45
45
|
"author": "Lacspace <contact@lacspace.com>",
|
|
46
46
|
"license": "SEE LICENSE IN LICENSE",
|
|
47
|
-
"homepage": "https://lacspace.com/packages",
|
|
47
|
+
"homepage": "https://developer.lacspace.com/packages/money",
|
|
48
48
|
"repository": {
|
|
49
49
|
"type": "git",
|
|
50
50
|
"url": "git+https://github.com/lacspace/npm-packages.git",
|