A JavaScript open-source package to easily calculate monthly mortgage payments, total repayment, and total interest.
yarn add calculator-home-loan
import calculateHomeLoan from 'calculator-home-loan';
const loan = 80000;
const years = 30;
const rate = 4.5;
const frequency = 12;
calculateHomeLoan(loan, years, rate, frequency);
// Output
{
monthlyPayment: 405.35,
totalPayment: 145925.37,
totalInterest: 65925.37
}
If you find any issues or have suggestions for improvements, feel free to open a pull request or issue. Your contribution is highly appreciated.
npx ava
This package is open-sourced software licensed under the MIT license.