1.1.1 • Published 3 years ago

cashmoneyloan v1.1.1

Weekly downloads
342
License
ISC
Repository
-
Last release
3 years ago

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

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago