AbakoJS
Every JS project that touches money ends up reinventing the same wheel. AbakoJS distills the patterns from e-commerce, fintech and crypto projects into a single, auditable, zero-dependency library. The name comes from the abacus (the oldest calculation tool) because the goal is the same: reliable, exact arithmetic that never surprises you.
# why i built this
After solving floating-point money problems repeatedly across different projects, I distilled the patterns into AbakoJS.
# key features
All operations use integer-scaled math internally, avoiding IEEE 754 floating-point drift. 0.1 + 0.2 === 0.30. Always.
Apply percentage fees, flat surcharges, tiered discounts and chained promotions with a fluent API.
Split a total into N parts proportionally or equally, distributing any remainder penny deterministically.
# highlights
- Zero external dependencies
- Ships dual ESM + CJS
- Works in Node.js, Deno, Bun and the browser
- Crypto assets with up to 18 decimal places