cashmoneyloan

This is a financial loan and mortgage calculator package

Usage no npm install needed!

<script type="module">
  import cashmoneyloan from 'https://cdn.skypack.dev/cashmoneyloan';
</script>

README

Image

Cashmoneyloan

Cashmoneyloan is a tool for performing calculations on loans in JavaScript.

Features

  1. Calculate monthly payment figures (loanMonthlyPayment)
  2. Loan total Interest (totalInterest)
  3. Income Balance after loan Instalment (netIncomeBalance)
  4. Payment to income ratio (loanPaymentToIncome)

Usage


With npm: npm install cashmoneyloan

Calculate monthly payment figures

This displays figures meant to be montly payments.

leveraging destructuring
Example: (Node js)
const { loanMonthlyPayment, totalInterest, netIncomeBalance, loanPaymentToIncome } = require('cashmoneyloan'); // ./index.js

loanMonthlyPayment(loanAmount, monthlyLoanPeriod, interestRate)

loanPaymentToIncome(loanInstalments, income);
 
totalInterest(loanMonthlyPayment, monthlyLoanPeriod, loanAmount);
 
netIncomeBalance(income, loanInstalments);
 
console.log(loanMonthlyPayment(1000000,10,10)); //104640
Example: (React js)
import {loanMonthlyPayment, loanPaymentToIncome, netIncomeBalance} from 'cashmoneyloan';

export default function App() {
  const income = 5000;
  const loanAmount = 100000;
  const monthlyLoanPeriod = 60;
  const interestRate = 10;

  
  const monthlyLoanInstalment = loanMonthlyPayment(loanAmount,monthlyLoanPeriod,interestRate);
  const paymentToIncomeRatio = loanPaymentToIncome(monthlyLoanInstalment, income);
  const IncomeBalance = netIncomeBalance(income, monthlyLoanInstalment);

  return (
    <div className="container">
      <h1>LOAN CALCULATOR</h1>
      
      <p>Customer: James Opio</p>
      
      <p>Income: ${income}</p>
      
      <p>Mortgage : ${loanAmount}</p>
      
      <p>Duration: {monthlyLoanPeriod} months</p>
      
      <p>Rate: {interestRate}%</p>
      
      <p>Loan Instalment: ${monthlyLoanInstalment}</p>
      
      <p>Percetage of loan instalment <br/>
       to income : ${paymentToIncomeRatio}</p>
       
      <p>Income Balance after loan instalment : ${IncomeBalance}</p>
    </div>
  );
}

GITHUB - Readme