npm install --save tiny-mortgage
const Mortgage = require('tiny-mortgage')
const m = new Mortgage(700000, 20, 4, 30)
The Mortgage class takes 4 parameters all of which are required.
- Total Cost of the house
- Down Payment Percentage (represented as a whole number between 1 - 100)
- Interest Rate (represented as a whole number between 0-20)
- Number of Years of the Loan
Get The Monthly Total
m.getMonthly()
Get The Total Amount to be Paid over the life of the loan including interest
m.getTotal()
Get the Principle/Interest Breakdown for a given month in the loan term
m.getSpecificMonth(124)
- For a 30 year Fixed Rate Loan: 1 - 360
- For a 15 year Fixed Rate Loan: 1 - 180