CashflowJS is comprehensive JavaScript library for time value of money calculations and financial analysis.
CashflowJS includes TypeScript definitions for all functions and return types.
Use the package manager npm to install cashflowjs.
npm install cashflowjs
🎯 Try the Interactive Demo - Explore all CashFlowJS functions with live calculations and visualizations
var cashflowjs = require('cashflowjs');
// Basic cash flow functions
const pv = cashflowjs.pv(1000, 0.05, 5, 1); // PV of $1000 in 5 years at 5% annual interest
const fv = cashflowjs.fv(1000, 0.05, 5, 1); // FV of $1000 in 5 years at 5% annual interest
const pv_cont = cashflowjs.pv(1000, 0.05, 5); // PV of $1000 in 5 years with continuous compounding
const fv_cont = cashflowjs.fv(1000, 0.05, 5); // FV of $1000 in 5 years with continuous compounding
// Annuity calculations
const pvoa = cashflowjs.pvoa(100, 0.05, 10, 12); // PV of $100 monthly payment for 10 years at 5%
const pvad = cashflowjs.pvad(100, 0.05, 10, 12); // PV of annuity due
const fvoa = cashflowjs.fvoa(100, 0.05, 10, 12); // FV of ordinary annuity
const fvad = cashflowjs.fvad(100, 0.05, 10, 12); // FV of annuity due
const pmt = cashflowjs.pmt(10000, 0.05, 60, 12); // Monthly payment on $10,000 loan
const nper = cashflowjs.nper(10000, 200, 0.05, 12); // How long to pay off $10,000 at $200/month
For issue submission please visit GitHub
Pull requests are welcome for bug resolution. Please open an issue prior to initiating a pull request.