https://github.com/dazlab-team/loan-calc-typescript
Loan calculator written in TypeScript. OO interface. ARM (Adjustable Rate Mortgage) options. Interest only repayments. Extra monthly payments option.
https://github.com/dazlab-team/loan-calc-typescript
arm calculator formulas interest loan mortgage principal repayments
Last synced: about 2 months ago
JSON representation
Loan calculator written in TypeScript. OO interface. ARM (Adjustable Rate Mortgage) options. Interest only repayments. Extra monthly payments option.
- Host: GitHub
- URL: https://github.com/dazlab-team/loan-calc-typescript
- Owner: dazlab-team
- License: mit
- Created: 2021-01-22T19:23:07.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-29T18:16:50.000Z (almost 4 years ago)
- Last Synced: 2025-02-14T21:03:09.321Z (2 months ago)
- Topics: arm, calculator, formulas, interest, loan, mortgage, principal, repayments
- Language: TypeScript
- Homepage:
- Size: 70.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# loan-calc-typescript
Loan calculator written in TypeScript.
OO interface.
ARM (Adjustable Rate Mortgage) options.
Interest only repayments.
Extra payments option.## Installation
```
npm install @dazlab-team/loan-calc
```## Usage examples
### Basic usage
```typescript
import {Loan} from '@dazlab-team/loan-calc';let loan = new Loan();
loan.amount = 800000;
loan.years = 25;
loan.interestRate = 2.56;console.log(loan.totalCost);
console.log(loan.totalInterest);
console.dir(loan.payments);
```### Extra monthly payments
```typescript
import {Loan} from '@dazlab-team/loan-calc';let loan = new Loan();
loan.amount = 800000;
loan.years = 25;
loan.interestRate = 2.56;
loan.extraPayment = 1000;console.log(loan.totalCost);
console.log(loan.totalInterest);
console.dir(loan.payments);
```### Interest only repayments
```typescript
import {Loan} from '@dazlab-team/loan-calc';let loan = new Loan();
loan.amount = 800000;
loan.years = 25;
loan.interestRate = 2.56;
loan.interestOnlyYears = 3;console.log(loan.totalCost);
console.log(loan.totalInterest);
console.dir(loan.payments);
```### ARM
Please note that the trivial ARM rate calculation strategy is implemented at the
moment which implies increasing the initial variable rate by fixed percentage each
N months (N=12 by default).Here's an example:
```typescript
import {Loan} from '@dazlab-team/loan-calc';let loan = new Loan();
loan.amount = 800000;
loan.years = 25;
loan.interestRate = 2.56;loan.armInitialVariableRate = 1.86;
loan.armMaximumInterestRate = 3.56;
loan.armExpectedAdjustmentRate = 0.25;
loan.armMonthsBetweenAdjustments = 12;
loan.armFixedRateForYears = 1;console.log(loan.totalCost);
console.log(loan.totalInterest);
console.dir(loan.payments);
```### Rounding
```typescript
import {Loan} from '@dazlab-team/loan-calc';let loan = new Loan();
loan.amount = 800000;
loan.years = 25;
loan.interestRate = 2.56;
loan.rounding = 0; // means to calculate numbers with no fraction partconsole.log(loan.totalCost);
console.log(loan.totalInterest);
console.dir(loan.payments);
```### Repayment frequency
```typescript
import {Loan} from '@dazlab-team/loan-calc';let loan = new Loan();
loan.amount = 800000;
loan.years = 25;
loan.interestRate = 2.56;
loan.repaymentFrequency = 'fortnightly';console.log(loan.totalCost);
console.log(loan.totalInterest);
console.dir(loan.payments);
```