loan-calc
v0.2.1
Published
Calculate monthly loan payments
Downloads
771
Readme
Quickly calculate monthly payments and the total amount of interest paid for a fixed rate loan.
Installation
First install node.js. Then:
npm install loan-calc --save
Usage
Require the module and pass the amount of the loan, annual rate, and length of loan in months.
var LoanCalc = require('loan-calc');
LoanCalc.paymentCalc({
amount: 200000,
rate: 5,
termMonths: 180
});
// returns 1581.59
LoanCalc.totalInterest({
amount: 200000,
rate: 5,
termMonths: 360
});
// returns 186511.57
You can also pass the loan amount as a US currency formatted string:
LoanCalc.paymentCalc({
amount: '$200,000',
rate: 5,
termMonths: 180
});
// returns 1581.59