Socket
Socket
Sign inDemoInstall

@danacita/loanjs

Package Overview
Dependencies
3
Maintainers
5
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @danacita/loanjs

A loan calculator for Dana Cita


Version published
Maintainers
5
Created

Readme

Source

Loanjs Build Status Coverage Status npm NPM

Loanjs is a loan calculator that we use internally at Dana Cita.

Installation

npm i @danacita/loanjs

Features

Creating a new Repayment Schedule

let repaymentSchedule = new RepaymentSchedule({
  startDate: new Date(2017, 4, 7),
  tenor: 7,
  interestRatePerYear: 10.0,
  balanceRequested: 1250000,
  origination: 10.0
});

Generate a new Repayment Schedule

repaymentSchedule.generateSchedule();

Documentation

Repayment Schedule

new Repayment(options);
Options
PropertiesTypeDefaultDescription
startDateDate*requiredThe starting date of the loan
tenornumber12The amount of time left for the repayment of the loan
interestPerYearnumber*requiredThe effective interest rate per year in percent (e.g: 20.5)
balanceRequestednumber*requiredNew / additional balance requested
originationnumber0An upfront fee charged by a lender in percent (e.g: 3.5)
gracePeriodnumber0A set period of time before borrower must begin repayment of the loan

Generate Schedule

generateSchedule();
Returns
[
  {
    date: '7-May-2017',
    month: 0,
    balance: 1375000,
    payment: 0,
    interest: 0,
    principal: 0
  },
  {
    date: '7-Jun-2017',
    month: 1,
    balance: 1183428,
    payment: 203031,
    interest: 11458,
    principal: 191572
  },
  {
    date: '7-Jul-2017',
    month: 2,
    balance: 990259,
    payment: 203031,
    interest: 9862,
    principal: 193169
  },
  {
    date: '7-Aug-2017',
    month: 3,
    balance: 795481,
    payment: 203031,
    interest: 8252,
    principal: 194778
  },
  {
    date: '7-Sep-2017',
    month: 4,
    balance: 599079,
    payment: 203031,
    interest: 6629,
    principal: 196402
  },
  {
    date: '7-Oct-2017',
    month: 5,
    balance: 401041,
    payment: 203031,
    interest: 4992,
    principal: 198038
  },
  {
    date: '7-Nov-2017',
    month: 6,
    balance: 201353,
    payment: 203031,
    interest: 3342,
    principal: 199689
  },
  {
    date: '7-Dec-2017',
    month: 7,
    balance: 0,
    payment: 203031,
    interest: 1678,
    principal: 201353
  }
];

License

Copyright (c) 2019 Dana Cita
Licensed under the MIT license.

Keywords

FAQs

Last updated on 25 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc