Menu

A zero-dependency financial math library for TypeScript
πŸ“°

A zero-dependency financial math library for TypeScript

DEV Community: typescriptΒ·Shilpi DaswaniΒ·about 23 hours ago
#OPhTXKAp
#devtotypescript#devto#dev#bond#finlytic
Reading 0:00
15s threshold

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.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.