A zero-dependency financial math library for TypeScript
If you've ever needed to do real financial math in JavaScript, you've probably noticed the ecosystem thins out fast. The basic time-value-of-money functions β PMT, FV, IRR β are everywhere. But the moment you reach for bond duration, convexity, XIRR over irregular dates, or a proper day-count convention, you're left choosing between a heavyweight Excel-formula port and writing it yourself.
So I built finlytic: a small, dependency-free, fully typed library for the financial calculations themselves.
npm install finlytic
The gap
Two things are genuinely hard to find in JS/TS finance libraries:
Bond analytics β price, yield to maturity, and especially interest-rate risk: Macaulay duration, modified duration, convexity. These are standard in a fixed-income context and almost absent from zero-dependency JS packages.
Dated cash flows β XNPV / XIRR, where the flows fall on arbitrary calendar dates rather than neat equal periods.β¦