{"id":18532632,"url":"https://github.com/ethan7g/mathvm","last_synced_at":"2025-04-09T14:31:38.739Z","repository":{"id":57292476,"uuid":"215458074","full_name":"ethan7g/mathvm","owner":"ethan7g","description":"Node math processing and execution","archived":true,"fork":false,"pushed_at":"2020-05-24T20:33:03.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T07:13:58.620Z","etag":null,"topics":["math","math-expression-evaluator","math-parser","nodejs"],"latest_commit_sha":null,"homepage":"","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/ethan7g.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}},"created_at":"2019-10-16T04:38:53.000Z","updated_at":"2024-02-17T09:33:16.000Z","dependencies_parsed_at":"2022-08-27T12:20:58.782Z","dependency_job_id":null,"html_url":"https://github.com/ethan7g/mathvm","commit_stats":null,"previous_names":["ethan7g/mathvm","ethanent/mathvm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethan7g%2Fmathvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethan7g%2Fmathvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethan7g%2Fmathvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethan7g%2Fmathvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethan7g","download_url":"https://codeload.github.com/ethan7g/mathvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055144,"owners_count":21040126,"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":["math","math-expression-evaluator","math-parser","nodejs"],"created_at":"2024-11-06T19:07:14.621Z","updated_at":"2025-04-09T14:31:38.365Z","avatar_url":"https://github.com/ethan7g.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mathvm\n\u003e Node math processing and execution VM\n\n[GitHub](https://github.com/ethanent/mathvm) | [NPM](https://www.npmjs.com/package/mathvm)\n\n## Install\n\n```\nnpm i mathvm\n```\n\n```js\nconst mathvm = require('mathvm')\n```\n\n## Use\n\n```js\nmathvm.exec('1 + 5')\n// =\u003e 6\n```\n\n```js\nmathvm.exec('7 + x ^ 2', {\n\t'vars': {\n\t\t'x': 2\n\t}\n})\n// =\u003e 11\n```\n\n```js\nmathvm.exec('asin(cos(pi))')\n// =\u003e -Pi/2\n```\n\n```js\nmathvm.exec('5 * add(x, 3)', {\n\t'functions': {\n\t\t'add': (a, b) =\u003e a + b\n\t},\n\t'vars': {\n\t\t'x': 2\n\t}\n})\n// =\u003e 25\n```\n\n## EnvSets\n\n```js\nmathvm.exec('sin(pi / 2)')\n// =\u003e 1\n\nmathvm.exec('sin(pi / 2)', {}, [])\n// Errors, function sin does not exist\n\nmathvm.exec('sin(pi / 2)', {}, ['trig'])\n// =\u003e 1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethan7g%2Fmathvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethan7g%2Fmathvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethan7g%2Fmathvm/lists"}