{"id":22848858,"url":"https://github.com/eckhardt-d/businessjs","last_synced_at":"2025-03-31T06:13:05.410Z","repository":{"id":57191804,"uuid":"173148523","full_name":"Eckhardt-D/businessjs","owner":"Eckhardt-D","description":"A new finance library for javascript. Intended to improve the workflow of JavaScript developers who are also in the finance industry.","archived":false,"fork":false,"pushed_at":"2019-03-05T10:06:34.000Z","size":874,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-11T16:49:57.077Z","etag":null,"topics":["finance","financial-analysis","time-value-of-money"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eckhardt-D.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-28T16:38:00.000Z","updated_at":"2020-02-21T20:17:19.000Z","dependencies_parsed_at":"2022-09-16T05:00:14.049Z","dependency_job_id":null,"html_url":"https://github.com/Eckhardt-D/businessjs","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/Eckhardt-D%2Fbusinessjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eckhardt-D%2Fbusinessjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eckhardt-D%2Fbusinessjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eckhardt-D%2Fbusinessjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eckhardt-D","download_url":"https://codeload.github.com/Eckhardt-D/businessjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423726,"owners_count":20774820,"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":["finance","financial-analysis","time-value-of-money"],"created_at":"2024-12-13T04:15:03.263Z","updated_at":"2025-03-31T06:13:05.389Z","avatar_url":"https://github.com/Eckhardt-D.png","language":"JavaScript","readme":"# businessjs\n\nA new finance library for javascript. Intended to improve the workflow of JavaScript developers who are also in the finance industry.\nThe package includes nice helper functions to quickly get values for ratio analysis, time value of money, managerial calculations etc.\n\n\u003e Currently version 1.x.x only has Time Value of Money\n\n## To get started\n\n```bash\nnpm install businessjs\n```\n\n## get CDN\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/businessjs@1.2.1/build/index.min.js\"\u003e\u003c/script\u003e\n```\n\nThis will give you the package available for use in any front-end or Node.js environment.\n\n## Guide\n\n### Time Value of money\n\nImport syntax:\n\n```js\nimport businessjs from 'businessjs';\n```\n\nIn node environment:\n\n```js\nconst businessjs = require('businessjs');\nconst tvm = businessjs.tvm;\n```\n\n## Browser support from node_modules\n\n\u003e Using the CDN is recommended though.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript src=\"node_modules/businessjs/build/index.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\nThis should create the instance globally on the window\n\n```html\n\u003cscript\u003e\n  const tvm = businessjs.tvm;\n\u003c/script\u003e\n```\n\n# Time Value of Money\n\nMethods\n\n#### `futureValue = function(presentValue, interest, [numPeriods = 1, perPeriod = 1])`\n  - Requires the present value and effective interest in decimal format and returns a future value based on a number of periods.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `presentValue = function(futureValue, interest, [numPeriods = 1, perPeriod = 1])`\n  - Requires the present value and interest in decimal format and returns a future value.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `numPeriods = function(presentValue, futureValue, interest, [perPeriod = 1])`\n  - Returns the number of periods that an investment / loan would take to realise, pay off. \n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `interest = function(presentValue, futureValue, [numPeriods = 1, perPeriod = 1])`\n  - Returns the interest rate of a given investment/loan.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `futureValueAnnuityDue = function(payment, interest, [numPeriods = 1, perPeriod = 1])`\n  - Returns the future value of an annuity paid at the end of every cycle with an effective interest rate.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `futureValueAnnuityAdvance = function(payment, interest, [numPeriods = 1, perPeriod = 1])`\n  - Returns the future value of an annuity paid at the beginning of every cycle with an effective interest rate.  \n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n  \n#### `presentValueAnnuityDue = function(payment, interest, [numPeriods = 1, perPeriod = 1])`\n  - Returns the present value of an annuity paid at the end of every cycle with an effective interest rate.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `presentValueAnnuityAdvance = function(payment, interest, [numPeriods = 1, perPeriod = 1])`\n  - Returns the present value of an annuity paid at the beginning of every cycle with an effective interest rate.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 1.\n\n#### `effectiveRate = function(nominalRate, perPeriod)`\n  - Returns the annual effective interest rate from a nominal rate and per-period compund amount.\n  - Useful because all other functions use effective rate, eg.\n\n  ```js\n  const tvm = require('businessjs').tvm;\n\n  // Convert the monthly nominal rate to yearly effective inline\n  tvm.futureValue(100, tvm.effectiveRate(0.1, 12), 1, 1);\n  ```\n\n#### `amortisation = function(presentValue, interest, [numPeriods=1, perPeriod=12])`\n  - Returns an array of objects that have the following shape:\n  ```js\n  {\n    period,\n    payment,\n    interestPortion,\n    principlePortion,\n    totalBalance,\n    principleBalance\n  }\n  ```\n  - Returns the tabular data of an amortisation with breakdown of interest and principle amounts.\n  - `numPeriods` defaults to 1 as in 1 year.\n  - `perPeriod` The amount of times an interest rate is compounded defaults to 12 payments per year.\n\n\nThese are just the first few methods in version 1, Documentation will be updated as version improves.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feckhardt-d%2Fbusinessjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feckhardt-d%2Fbusinessjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feckhardt-d%2Fbusinessjs/lists"}