{"id":13727189,"url":"https://github.com/lmammino/financial","last_synced_at":"2025-05-15T13:06:20.632Z","repository":{"id":41823098,"uuid":"275629272","full_name":"lmammino/financial","owner":"lmammino","description":"A Zero-dependency TypeScript/JavaScript financial library (based on numpy-financial) for Node.js, Deno and the browser","archived":false,"fork":false,"pushed_at":"2024-07-20T16:46:50.000Z","size":333,"stargazers_count":722,"open_issues_count":0,"forks_count":21,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-12T19:13:05.432Z","etag":null,"topics":["deno","financial","javascript","mortgage","node","nodejs","numpy","numpy-financial","typescript","zero-dependency"],"latest_commit_sha":null,"homepage":"https://financialjs.netlify.app/","language":"TypeScript","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/lmammino.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}},"created_at":"2020-06-28T16:55:27.000Z","updated_at":"2025-04-23T02:25:30.000Z","dependencies_parsed_at":"2024-08-03T01:29:48.175Z","dependency_job_id":"e606669c-7421-4833-9235-896e47c5b2fd","html_url":"https://github.com/lmammino/financial","commit_stats":{"total_commits":30,"total_committers":3,"mean_commits":10.0,"dds":0.06666666666666665,"last_synced_commit":"3c7f103df1ce6817b7369b94c8bb5afe50ab1312"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Ffinancial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Ffinancial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Ffinancial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmammino%2Ffinancial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmammino","download_url":"https://codeload.github.com/lmammino/financial/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"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":["deno","financial","javascript","mortgage","node","nodejs","numpy","numpy-financial","typescript","zero-dependency"],"created_at":"2024-08-03T01:03:43.476Z","updated_at":"2025-05-15T13:06:20.613Z","avatar_url":"https://github.com/lmammino.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","Helper Components"],"sub_categories":[],"readme":"# Financial\n\n[![npm version](https://badge.fury.io/js/financial.svg)](https://badge.fury.io/js/financial)\n[![CI](https://github.com/lmammino/financial/workflows/CI/badge.svg)](https://github.com/lmammino/financial/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/lmammino/financial/branch/main/graph/badge.svg)](https://codecov.io/gh/lmammino/financial)\n[![Documentation](https://api.netlify.com/api/v1/badges/eca2653e-dcaa-41db-865c-ab635687e69d/deploy-status)](https://financialjs.netlify.app/)\n\nA Zero-Dependency TypeScript / JavaScript financial utility library inspired by [numpy-financial](https://github.com/numpy/numpy-financial/) that can be used on **Node.js**, **Deno**, **Bun** and **the browser**.\n\nIt does support the same functionality offered by `numpy-financial` but it only supports scalar JavaScript `number` values (NO numpy-like array values) and it does NOT support arbitrary-precision signed decimal numbers (such as decimal.js, big.js or bignumber.js).\n\n\n📖 **API DOCS** 📖 : [financialjs.netlify.app](https://financialjs.netlify.app)\n\n\n[![Example usage in a picture](https://repository-images.githubusercontent.com/275629272/b295b880-bd3e-11ea-8860-705f2f6427ec)](https://repository-images.githubusercontent.com/275629272/b295b880-bd3e-11ea-8860-705f2f6427ec)\n\n\n## Install\n\nWith `npm`:\n\n```bash\nnpm install --save-dev financial\n```\n\nOr, with `yarn`:\n\n```bash\nyarn add financial\n```\n\n\n## Example usage\n\n```javascript\nimport { fv } from 'financial'\n\nfv(0.05 / 12, 10 * 12, -100, -100) // 15692.928894335748\n```\n\n## Module formats\n\nThis library exports its functionality using different module formats.\n\n\n### Commonjs\n\n```javascript\nconst financial = require('financial') // ./index.js\n\n// use `financial.fv`, `financial.pmt`, etc.\n```\n\nor, leveraging destructuring\n\n```javascript\nconst { fv, pmt } = require('financial') // ./index.js\n\n// use `fv`, `pmt`, etc.\n```\n\nAn optimized Commonjs for browsers can be imported directly from the web:\n\n```html\n\u003cscript src=\"https://www.npmcdn.com/financial@x.y.z/dist/financial.cjs.production.min.js\"\u003e\u003c/script\u003e\n```\n\n**Note**: make sure you replace the `x.y.z` with the correct version you want to use.\n\n\n### ESM (EcmaScript Modules)\n\nAlso working with Typescript\n\n```javascript\nimport { fv, pmt } from 'financial'\n\n// use `fv`, `pmt`, etc.\n```\n\nThere's no `default` export in the ESM implementation, so you have to explicitely import the functionality you need, one by one.\n\n\n### Use with Deno\n\nMake sure you specify the version you prefer in the import URL:\n\n```typescript\nimport { assertEquals } from 'https://deno.land/std/testing/asserts.ts'\nimport * as f from 'https://deno.land/x/npm:financial@0.1.1/src/financial.ts'\n\nassertEquals(f.fv(0.05 / 12, 10 * 12, -100, -100), 15692.928894335755)\n```\n\n\n## Implemented functions and Documentation\n\nClick on the function name to get the full documentation for every function, or check out the full programmatic documentation at [financialjs.netlify.app](https://financialjs.netlify.app).\n\n - [X] [`fv()`: Future Value](https://financialjs.netlify.app/modules/_financial_.html#fv) (since v0.0.12)\n - [X] [`pmt()`: Total payment](https://financialjs.netlify.app/modules/_financial_.html#pmt) (since v0.0.12)\n - [X] [`nper()`: Number of period payments](https://financialjs.netlify.app/modules/_financial_.html#nper) (since v0.0.12)\n - [X] [`ipmt()`: Interest portion of a payment](https://financialjs.netlify.app/modules/_financial_.html#ipmt) (since v0.0.12)\n - [X] [`ppmt()`: Payment against loan principal](https://financialjs.netlify.app/modules/_financial_.html#ppmt) (since v0.0.14)\n - [X] [`pv()`: Present Value](https://financialjs.netlify.app/modules/_financial_.html#pv) (since v0.0.15)\n - [X] [`rate()`: Rate of interest per period](https://financialjs.netlify.app/modules/_financial_.html#rate) (since v0.0.16)\n - [X] [`irr()`: Internal Rate of Return](https://financialjs.netlify.app/modules/_financial_.html#irr) (since v0.0.17)\n - [X] [`npv()`: Net Present Value](https://financialjs.netlify.app/modules/_financial_.html#npv) (since v0.0.18)\n - [X] [`mirr()`: Modified Internal Rate of Return](https://financialjs.netlify.app/modules/_financial_.html#mirr) (since 0.1.0)\n\n\n## Local Development\n\nBelow is a list of commands you will probably find useful.\n\n - `npm start` or `yarn start`: Runs the project in development/watch mode. Your project will be rebuilt upon changes.\n - `npm run build` or `yarn build`: Bundles the package to the `dist` folder. The package is optimized and bundled with Rollup into multiple format (CommonJS, UMD, and ES Module).\n - `npm run build:docs` or `yarn build:docs`: Builds the API documentation in the `docs` folder using `typedoc`.\n - `npm test` or `yarn test`: Runs the test watcher (Jest) in an interactive mode. it runs tests related to files changed since the last commit.\n - `npm run test:watch` or `yarn test:watch`: runs the tests in watch mode\n\n\n### Test with Deno\n\nTo test with Deno, run:\n\n```bash\ndeno test test/deno.ts\n```\n\n\n## Contributing\n\nEveryone is very welcome to contribute to this project. You can contribute just by submitting bugs or\nsuggesting improvements by [opening an issue on GitHub](https://github.com/lmammino/financial/issues).\n\nYou can also submit PRs as long as you adhere with the code standards and write tests for the proposed changes.\n\n## License\n\nLicensed under [MIT License](LICENSE). © Luciano Mammino.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmammino%2Ffinancial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmammino%2Ffinancial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmammino%2Ffinancial/lists"}