1.1.8 • Published 2 days ago
payment-plan v1.1.8
Payment plan
Introduction
Use this lib to calculate payment plan, monthly cost and effective interest.
Install
npm install payment-plan
or
yarn add payment-plan
Functions
Function | Description |
---|---|
getEffectiveInterest | Calculate the effective interest rate for a loan |
getPaymentPlan | Generate a payment plan for a loan |
getMonthlyCost | Calculate the monthly cost for a specific term of a loan |
Inputs
getEffectiveInterest
Input | Type | Description | Default Value |
---|---|---|---|
loanAmount | number | Loan amount | - |
terms | number | Total number of terms | - |
interestRate | number | Annual nominal interest rate (as a decimal) | - |
startFee | number | One-time start fee | - |
termFee | number | Fee per term | - |
type | LoanTypes (optional) | Loan type (ANNUITY or SERIAL) | ANNUITY |
plan | PaymentPlan (optional) | Existing payment plan to use instead of generating one | - |
getPaymentPlan
Input | Type | Description | Default Value |
---|---|---|---|
loanAmount | number | Loan amount | - |
interestRate | number | Annual nominal interest rate (as a decimal) | - |
terms | number | Total number of terms | - |
gracePeriod | number (optional) | Number of grace period terms | 0 |
type | LoanTypes (optional) | Loan type (ANNUITY or SERIAL) | ANNUITY |
startFee | number (optional) | One-time start fee | 0 |
termFee | number (optional) | Fee per term | 0 |
getMonthlyCost
Input | Type | Description | Default Value |
---|---|---|---|
loanAmount | number | Loan amount | - |
terms | number | Total number of terms | - |
interestRate | number | Annual nominal interest rate (as a decimal) | - |
period | number (optional) | Number of terms per year | 12 |
index | number (optional) | Term index to calculate the monthly cost for | 0 |
gracePeriod | number (optional) | Number of grace period terms | 0 |
termFee | number (optional) | Fee per term | 0 |
type | LoanTypes (optional) | Loan type (ANNUITY or SERIAL) | ANNUITY |
License
MIT License