{"id":22538101,"url":"https://github.com/cfpb/amortize","last_synced_at":"2025-08-22T01:32:45.845Z","repository":{"id":57177387,"uuid":"20699597","full_name":"cfpb/amortize","owner":"cfpb","description":"A node module to calculate the interest paid, principal paid, remaining balance, and monthly payment of a loan.","archived":false,"fork":false,"pushed_at":"2018-07-21T18:12:38.000Z","size":105,"stargazers_count":58,"open_issues_count":0,"forks_count":19,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-12-07T11:10:06.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfpb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-10T20:01:04.000Z","updated_at":"2023-10-16T04:27:33.000Z","dependencies_parsed_at":"2022-09-04T11:51:59.931Z","dependency_job_id":null,"html_url":"https://github.com/cfpb/amortize","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Famortize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Famortize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Famortize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Famortize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfpb","download_url":"https://codeload.github.com/cfpb/amortize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230547678,"owners_count":18243227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T11:10:09.872Z","updated_at":"2024-12-20T07:07:05.238Z","avatar_url":"https://github.com/cfpb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"amortize\n========\n\n[![Build Status](https://travis-ci.org/cfpb/amortize.svg?branch=master)](https://travis-ci.org/cfpb/amortize) [![codecov](https://codecov.io/gh/cfpb/amortize/branch/master/graph/badge.svg)](https://codecov.io/gh/cfpb/amortize)\n\nA node module to calculate the interest paid, principal paid, remaining balance, and monthly payment of a loan.\n\n### What is loan amortization?\n\nFrom [Ask CFPB](http://www.consumerfinance.gov/askcfpb/771/what-amortization-and-how-could-it-affect-my-loan.html):\n\n\u003e Amortization describes the process of gradual payment of the amount on your loan. For each of your monthly payments, a portion is applied towards the amount of the loan – the principal – and a portion of the payment is applied towards paying the finance charge – the interest.\n\n\u003e A greater percentage of your monthly payment is applied to interest early in the life of the loan, and a greater percentage is applied to the principal at the end. Thus, the principal balance decreases slowly at first and more quickly closer to the end of the loan term. So if you default early in the life of the loan, you will still owe a significant amount on the principal because only a relatively small percentage of your monthly payments were applied to the principal.\n\n## Installation\n\nFirst install [node.js](http://nodejs.org/). Then:\n\n```sh\nnpm install amortize --save\n```\n\n## Usage\nRequire the module and pass the amount of the loan, annual rate, the length of loan in months, and the length of time in months over which you would like to do the amortization calculation. For example for a loan amount of $180,000, an interest rate of 4.25%, a total term of 360 months (30 years) you could calculate the amortization over 60 months (5 years) with the following:\n\n```javascript\nvar amortize = require('amortize');\n\namortize({\n  amount: 180000,\n  rate: 4.25,\n  totalTerm: 360,\n  amortizeTerm: 60\n});\n```\n\nThis will return an object containing the interest, principal, balance, and monthly payment as both raw and rounded values:\n\n```javascript\n{\n  interest: 36583.362108097754,  // the interest paid in the amortization period\n  principal: 16546.146128485594, // the principal paid in the amortization period\n  balance: 163453.85387151438, // the balance left after the amortization period\n  payment: 885.4918039430557, // the monthly payments that would be made\n  interestRound: '36583.36',\n  principalRound: '16546.15',\n  balanceRound: '163453.85',\n  paymentRound: '885.49'\n}\n```\n\nThis module also supports straightline amortization schedules with equal principal payments:\n\n```javascript\namortize({\n  amount: 180000,\n  rate: 4.25,\n  totalTerm: 360,\n  amortizeTerm: 60,\n  repaymentType: 'equal-principal-payment',\n  partialMonthOffset: 0.5 // optional month offset\n});\n```\n\n\n## Contributing\n\nPlease read the [Contributing guidelines](CONTRIBUTING.md).\n\n### Running Tests\n\nWe are using [nodeunit](https://github.com/caolan/nodeunit) to test. To run tests, first install nodeunit and any dependencies via npm:\n\n```\nnpm install\n```\n\nRun tests with:\n\n```\nnpm test\n```\n\n## Notes\n\nThis module is intended for predictive purposes and assumes that the borrower does not pay more than the calculated payment each month.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Famortize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfpb%2Famortize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Famortize/lists"}