{"id":49810487,"url":"https://github.com/travishorn/financejs","last_synced_at":"2026-05-13T00:36:07.255Z","repository":{"id":342059225,"uuid":"1171851425","full_name":"travishorn/financejs","owner":"travishorn","description":"Excel-style time value of money and cash-flow formulas. This is a modern rewrite of tvm-financejs by kgkars.","archived":false,"fork":false,"pushed_at":"2026-04-24T20:22:46.000Z","size":408,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-24T21:30:09.028Z","etag":null,"topics":["amortization","excel","finance","financial","irr","loan","npv","rate","time-value-of-money","tvm"],"latest_commit_sha":null,"homepage":"https://travishorn.github.io/financejs/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/travishorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-03T17:17:33.000Z","updated_at":"2026-04-24T20:22:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/travishorn/financejs","commit_stats":null,"previous_names":["travishorn/financejs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/travishorn/financejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Ffinancejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Ffinancejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Ffinancejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Ffinancejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/travishorn","download_url":"https://codeload.github.com/travishorn/financejs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travishorn%2Ffinancejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32963172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["amortization","excel","finance","financial","irr","loan","npv","rate","time-value-of-money","tvm"],"created_at":"2026-05-13T00:36:05.533Z","updated_at":"2026-05-13T00:36:07.246Z","avatar_url":"https://github.com/travishorn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# financejs\n\nExcel-style time value of money and cash-flow formulas. This is a modern rewrite\nof [tvm-financejs](https://github.com/kgkars/tvm-financejs/) by\n[kgkars](https://github.com/kgkars).\n\n## Why this rewrite\n\nThis project keeps the formula behavior and conventions from the original\nlibrary, but modernizes the implementation and tooling:\n\n- Native ESM\n- Named function exports (no class wrapper)\n- Native error handling\n- Strict type-checking\n- JSDoc documentation\n- Vitest-based test suite\n- 100% test coverage\n- ESLint + Prettier setup\n\n## Installation\n\n```bash\nnpm install @travishorn/financejs\n```\n\n## Usage\n\n```js\nimport { pmt, rate, irr } from \"@travishorn/financejs\";\n\nconst payment = pmt(0.0525, 5, -10000);\n// 2325.733168046526\n\nconst periodicRate = rate(60, 500, -25000);\n// 0.006183413161254404\n\nconst internalRate = irr([-1500, 500, 500, 500, 500]);\n// 0.12589832495374934\n```\n\nFor full API documentation, visit\n[https://travishorn.github.io/financejs/](https://travishorn.github.io/financejs/).\n\n## Excel-style conventions\n\n- Outputs are not rounded automatically.\n- `pv` is typically negative for loans/investments (same convention as Excel).\n- `type` means payment timing:\n  - `0` = end of period (arrears)\n  - `1` = beginning of period (advance)\n- `rate` must match period frequency (e.g., annual rate divided by 12 for\n  monthly periods).\n\n## Error behavior\n\nAll functions will either return a number, or throw `RangeError` for invalid\ninputs or non-convergent iterative solves.\n\n## Development\n\nClone the repository:\n\n```bash\ngit clone https://github.com/travishorn/financejs\n```\n\nChange into the directory:\n\n```bash\ncd financejs\n```\n\nRun tests:\n\n```bash\nnpm test\n```\n\nLint with ESLint:\n\n```bash\nnpm run lint\n```\n\nCheck types:\n\n```bash\nnpm run lint:types\n```\n\nFormat with Prettier:\n\n```bash\nnpm run format\n```\n\n## Notes on compatibility\n\nThis rewrite is intended to match Excel-style formulas closely (tests validate\nto 8 decimal places), while using a modern JavaScript module API.\n\n## Roadmap\n\nI want to add more [Excel financial\nfunctions](https://support.microsoft.com/en-us/office/financial-functions-reference-5658d81e-6035-4f24-89c1-fbf124c2b1d8)\nto the project. Since there are over 50 functions, broke them into \"tiers.\"\nTiers 1-3 are complete.\n\n- **Tier 1:** ✓pmt, ✓pv, ✓fv, ✓npv, ✓irr, ✓rate, ✓nper, ✓xnpv, ✓xirr\n- **Tier 2:** ✓ipmt, ✓ppmt, ✓cumipmt, ✓cumprinc, ✓sln, ✓db, ✓ddb, ✓effect,\n  ✓nominal, ✓syd, ✓mirr\n- **Tier 3:** ✓rri, ✓pduration, ✓vdb, ✓fvschedule, ✓dollarde, ✓dollarfr, ✓ispmt\n- **Tier 4:** ✓yield, ✓price, duration, mduration, disc, intrate, received,\n  pricedisc, pricemat, yielddisc, yieldmat\n- **Tier 5:** ✓coupdaybs, ✓coupdays, ✓coupdaysnc, all others\n\n## License\n\nThe MIT License\n\nCopyright 2020 kgkars  \nCopyright 2026 Travis Horn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the “Software”), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravishorn%2Ffinancejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftravishorn%2Ffinancejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravishorn%2Ffinancejs/lists"}