Nadie Programa más

    payment-plan
    TypeScript icon, indicating that this package has built-in type declarations

    0.3.1 • Public • Published

    Payment plan

    Introduction

    Use this lib to calculate payment plan, monthly cost and effective interest.

    Install

    yarn add payment-plan

    or

    npm install payment-plan

    Usage

    getPaymentPlan

    Input

    {
      loanAmount, // total loan amount
      interestRate, // interest rate, 100% is 1.
      terms // how many terms? ,
      gracePeriod = 0 // how many terms with grace (no instalments),
      type = loanTypes.ANNUITY // "annuity | serial",
      startFee = 0 // Not implemented yet.,
      termFee = 0 // added fee for each term
    }

    Output

    [
      {
        termNo //indexed term,
        startAmount // how much loan at the start of term,
        restAmount // rest after term,
        interestAmount, // how much interest in this term
        installment, // how much in installment
        monthlyPayment, // sum of term due
        monthlyFees, // how much in fees
        interestRate // interest rate (🤷‍♂️)
      }
    ]

    getMonthlyCost

    Input

    {
      loanAmount,
      terms,
      interestRate,
      period = 12,
      index = 0,
      gracePeriod = 0,
      termFee = 0,
      type = loanTypes.ANNUITY
    }

    Output

    The amount due for that month (index)

    getEffectiveInteres

    Input

    {
      loanAmount,
        terms,
        interestRate,
        startFee,
        termFee,
        type = loanTypes.ANNUITY,
        plan // optional. Will calculate new if not provided
    }

    Output

    Effective interest normalized [0..1]

    Keywords

    none

    Install

    npm i payment-plan

    DownloadsWeekly Downloads

    144

    Version

    0.3.1

    License

    UNLICENCED

    Unpacked Size

    13.5 kB

    Total Files

    20

    Last publish

    Collaborators

    • slem