$ ls -la
drwxr-xr-x 7 user staff 256 ./
→cd ~
→./read→./play→./learn→./skills→./packages→./projects*
Projects/AbakoJS
Actively developedFinanceMIT

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.

Released January 2024Updated Apr 2026TypeScript · ESM · CJS
Open live projectSource codeDocs
abakojs
index.tsREADME.md
// npm i abakojs
import { AbakoJS } from "abakojs";
const result = AbakoJS.compute(100);
console.log(result); // → 100.00

# why i built this

After solving floating-point money problems repeatedly across different projects, I distilled the patterns into AbakoJS.

# key features

⚡Precise Arithmetic

All operations use integer-scaled math internally, avoiding IEEE 754 floating-point drift. 0.1 + 0.2 === 0.30. Always.

💸Fee & Discount Engine

Apply percentage fees, flat surcharges, tiered discounts and chained promotions with a fluent API.

🔀Value Partitioning

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

# built with

TypeScriptESMCJS
#money#currency#finance#arithmetic#typescript#esm
All projects
Open