@ashu959/loan-schedule
v1.0.15
Published
A library for calculating loan,bond payments
Downloads
11
Readme
Installation
Install the module to your project:
npm
npm install @ashu959/loan-schedule
yarn
yarn add @ashu959/loan-schedule
Getting Started
Loan init
import { LoanCalculator } from '@ashu959/loan-schedule/lib/loan';
const loan:any = new LoanCalculator(50000, 10,1); // Creating a new instance of the Loan class
const monthlyPaymentCycle:any = loan.calculatePaymentBreakdown();
console.log(JSON.stringify(monthlyPaymentCycle));
Response Content
[{"principal":3979.127694833827,"interest":416.6666666666667,"balance":46020.87230516617},{"principal":4012.287092290775,"interest":383.5072692097181,"balance":42008.5852128754},{"principal":4045.722818059865,"interest":350.0715434406283,"balance":37962.86239481553},{"principal":4079.4371748770304,"interest":316.3571866234627,"balance":33883.4252199385},{"principal":4113.432484667673,"interest":282.3618768328208,"balance":29769.99273527083},{"principal":4147.71108870657,"interest":248.08327279392358,"balance":25622.28164656426},{"principal":4182.275347779125,"interest":213.51901372136885,"balance":21440.006298785134},{"principal":4217.12764234395,"interest":178.6667191565428,"balance":17222.878656441186},{"principal":4252.270372696817,"interest":143.52398880367656,"balance":12970.608283744368},{"principal":4287.705959135957,"interest":108.0884023645364,"balance":8682.90232460841},{"principal":4323.436842128756,"interest":72.35751937173676,"balance":4359.465482479654},{"principal":4359.46548247983,"interest":36.328879020663784,"balance":-1.7553247744217515e-10}]
Bond init
import { BondCalculator } from '@ashu959/loan-schedule/lib/bond';
const bond:any = new BondCalculator(50000, 10,1); // Creating a new instance of the Bond class
const monthlyPaymentCycle:any = bond.calculatePaymentBreakdown();
console.log(JSON.stringify(monthlyPaymentCycle));
Response Content
[{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667},{"interest":416.6666666666667}]