Giter VIP home page Giter VIP logo

lease-calculator's Introduction

Car Lease Calculator ๐Ÿš—

License: MIT Npm Version

A simple auto lease calculator for calculating your monthly lease payment, APR, total lease cost, percentage off MSRP, etc.

See it used in the Auto Lease app: https://github.com/ErezNagar/lease-calculator-app

How To Use

npm install lease-calculator --save
const leaseCalculator = new LeaseCalculator();
leaseCalculator.calculate({
  // Make of the vehicle, for calculating manufacturer-based fees
  make: "Toyota",
  // Required, MSRP of the vehicle
  msrp: 23000,
  // Required, negotiated price of the vehicle
  sellingPrice: 21000,
  // Required, Residual value of the vehicle
  rv: 13110,
  // Whether the RV is an absolute value or a percentage of MSRP. Default: true
  isRVPercent: false,
  // Required, The money factor of the lease
  mf: 0.00125,
  // The state's sales tax in percentage. Default: 0%.
  salesTax: 6.25,
  // Total fees of the lease. Default: 0.
  totalFees: 1200,
});

// Get the lease monthly payment
const monthlyPayment = leaseCalculator.getMonthlyPayment();

API

Description
calculate() Main function to calculate lease total & monthly payments, APR, total cost, etc. Must be run first to calculated the different lease parameters.

Arguments:

calculate({
  // Make of the vehicle, for calculating manufacturer-based fees. Default: "".
  // See constants.js for valid values.
  make: "Toyota",
  // Required, MSRP of the vehicle
  msrp: 23000,
  // Required, negotiated price of the vehicle
  sellingPrice: 21000,
  // Required, Residual value of the vehicle.
  // If isRVPercent is true, value must be a percentage. I.e, if RV is 65%, rv should be 65.
  rv: 13110,
  // Whether the RV is an absolute value or a percentage of MSRP. Default: true
  isRVPercent: false,
  // Required, The money factor of the lease
  mf: 0.00125,
  // The length of the lease in months. Default: 36.
  leaseTerm: 36,
  // The state's sales tax in percentage. Default: 0%.
  salesTax: 6.25,
  // Total fees of the lease. Default: 0.
  totalFees: 1200,
  // Total discount from dealer and manufacturer. Default: 0.
  rebates: 500,
  // Total trade-in value. Default: 0.
  tradeIn: 0,
  // Down payment, if applicable. Default: 0.
  downPayment: 0,
  // Method of taxation to apply, based on state. Default: TAX_ON_MONTHLY_PAYMENT
  // See constants.js for valid values.
  taxMethod: 1,
});
getRVValue() Gets the residual value of the lease
getRVPercentage() Gets the residual value of the lease in percentage
getMonthlyPaymentPreTax() Gets the monthly payment of the lease, not including taxes
getMonthlyPayment() Gets the monthly payment of the lease, including taxes
getDiscountOffMsrpPercentage() Gets the discount off of MSRP, in percentage
getMonthlyPaymentToMsrpPercentage() Gets the percentage of the monthly payment out of the MSRP
getTotalLeaseCost() Gets the total cost of the lease. This includes all monthly payments, down paymenaand dealer fees. Does not include disposition fee, vehicle maintenance cost or other cost of use
getAPR() Gets the APR value of the lease
getAcquisitionFeeValue Gets the acquisition fee value by brand. If no brand sepcified, returns 0
getDispositionFeeValue Gets the disposition fee value by brand. If no brand sepcified, returns 0
getDriveOffPayment Gets total drive-off payment

Supported manufacturers

Lease Calculator supports acquisition and disposition fee calculation for the following brands:

Acura, Alfa Romeo, Audi, Bmw, Buick, Cadillac, Chevrolet, Chrysler, Dodge, Fiat, Ford, Genesis, GMC, Honda, Hyundai, Infiniti, Jaguar, Jeep, Kia, land rover, Lexus, Lincoln, Mini, Mazda, Mercedes benz, Mitsubishi, Nissan, Ram, Scion, Smart, Subaru, Tesla, Toyota, Volkswagen, Volvo

lease-calculator's People

Contributors

ereznagar avatar julianduque avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.