overall-loan-cost
Calculate the overall cost of a loan.
Installation
First install node.js. Then:
npm install overall-loan-cost --save
Usage
Basic usage
Require the module and pass it an object of loan values (amount borrowed, rate, and total loan term in months):
var cost = ; ;
This will return the total cost of the loan, total equity of the loan, and the overall cost of the loan (cost + equity):
totalCost: 23129508 totalEquity: 300000 overallCost: 53129508
Additional values
You can also include the down payment and closing costs of the loan.
;
Will return:
totalCost: 26129508 totalEquity: 320000 overallCost: 58129508
If you're interested in seeing the costs of a loan for a period that is shorter than the total life of the loan, you can pass the amortizeTerm
value in months:
This will return the total cost, total equity, and overall cost after 7 years:
totalCost: 8144902 totalEquity: 7808298 overallCost: 15953199
Contributing
Please read the Contributing guidelines.
Running Tests
We are using nodeunit to test. To run tests, first install nodeunit and any dependencies via npm:
npm install
Run tests with:
npm test