Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfpb/loan-calc
A node module to quickly calculate monthly payments and the total amount of interest paid for a fixed rate loan.
https://github.com/cfpb/loan-calc
Last synced: 17 days ago
JSON representation
A node module to quickly calculate monthly payments and the total amount of interest paid for a fixed rate loan.
- Host: GitHub
- URL: https://github.com/cfpb/loan-calc
- Owner: cfpb
- License: cc0-1.0
- Created: 2014-04-09T18:03:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-04-18T19:12:40.000Z (over 10 years ago)
- Last Synced: 2024-04-25T19:21:58.310Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 338 KB
- Stars: 13
- Watchers: 18
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: COPYING.txt
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/cfpb/loan-calc.svg?branch=master)](https://travis-ci.org/cfpb/loan-calc)
Quickly calculate monthly payments and the total amount of interest paid for a fixed rate loan.
## Installation
First install [node.js](http://nodejs.org/). Then:
```sh
npm install loan-calc --save
```## Usage
Require the module and pass the amount of the loan, annual rate, and length of loan in months.
```javascript
var LoanCalc = require('loan-calc');LoanCalc.paymentCalc({
amount: 200000,
rate: 5,
termMonths: 180
});
// returns 1581.59LoanCalc.totalInterest({
amount: 200000,
rate: 5,
termMonths: 360
});
// returns 186511.57
```You can also pass the loan amount as a US currency formatted string:
```javascript
LoanCalc.paymentCalc({
amount: '$200,000',
rate: 5,
termMonths: 180
});
// returns 1581.59
```## Contributing
Please read the [Contributing guidelines](CONTRIBUTING.md).
### Running Tests
We are using [nodeunit](https://github.com/caolan/nodeunit) to test. To run tests, first install nodeunit and any dependencies via npm:
```
npm install
```Run tests with:
```
npm test
```