{"id":22538149,"url":"https://github.com/cfpb/overall-loan-cost","last_synced_at":"2026-03-16T08:34:15.226Z","repository":{"id":19128796,"uuid":"22358320","full_name":"cfpb/overall-loan-cost","owner":"cfpb","description":"A node module to calculate the overall cost of a loan.","archived":false,"fork":false,"pushed_at":"2014-09-02T17:21:04.000Z","size":226,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-09T20:15:20.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-28T21:19:36.000Z","updated_at":"2018-07-01T22:58:21.000Z","dependencies_parsed_at":"2022-09-14T11:31:05.176Z","dependency_job_id":null,"html_url":"https://github.com/cfpb/overall-loan-cost","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Foverall-loan-cost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Foverall-loan-cost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Foverall-loan-cost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfpb%2Foverall-loan-cost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfpb","download_url":"https://codeload.github.com/cfpb/overall-loan-cost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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:33.205Z","updated_at":"2026-03-16T08:34:15.177Z","avatar_url":"https://github.com/cfpb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# overall-loan-cost [![Build Status](https://secure.travis-ci.org/cfpb/overall-loan-cost.png?branch=master)](http://travis-ci.org/cfpb/overall-loan-cost)\n\n[![browser support](https://ci.testling.com/cfpb/overall-loan-cost.png)\n](https://ci.testling.com/cfpb/overall-loan-cost)\n\n\u003e Calculate the overall cost of a loan.\n\n## Installation\n\nFirst install [node.js](http://nodejs.org/). Then:\n\n```sh\nnpm install overall-loan-cost --save\n```\n\n## Usage\n\n## Basic usage\n\nRequire the module and pass it an object of loan values (amount borrowed, rate, and total loan term in months):\n\n```javascript\nvar cost = require('overall-loan-cost');\n\ncost({\n  amountBorrowed: 300000,\n  rate: 4.25,\n  totalTerm: 360,\n});\n```\n\nThis will return the total cost of the loan, total equity of the loan, and the overall cost of the loan (cost + equity):\n\n```javascript\n{\n  totalCost: 231295.08,\n  totalEquity: 300000,\n  overallCost: 531295.08\n}\n```\n\n## Additional values\n\nYou can also include the down payment and closing costs of the loan.\n\n```javascript\ncost({\n  amountBorrowed: 300000,\n  rate: 4.25,\n  totalTerm: 360,\n  downPayment: 20000,\n  closingCosts: 30000\n});\n```\n\nWill return:\n\n```javascript\n{\n  totalCost: 261295.08,\n  totalEquity: 320000,\n  overallCost: 581295.08\n}\n```\n\nIf you're interested in seeing the costs of a loan for a period that is shorter than the total life of the loan, you can pass the `amortizeTerm` value in months:\n\n```javascript\ncost({\n  amountBorrowed: 255000,\n  rate: 4.5,\n  totalTerm: 360,\n  amortizeTerm: 84,\n  downPayment: 45000,\n  closingCosts: 6000\n})\n```\n\nThis will return the total cost, total equity, and overall cost after 7 years:\n\n```javascript\n{\n  totalCost: 81449.02,\n  totalEquity: 78082.98,\n  overallCost: 159531.99\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Foverall-loan-cost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfpb%2Foverall-loan-cost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfpb%2Foverall-loan-cost/lists"}