{"id":19787439,"url":"https://github.com/codeplea/rimath","last_synced_at":"2025-10-09T07:06:53.181Z","repository":{"id":110397704,"uuid":"169085571","full_name":"codeplea/rimath","owner":"codeplea","description":"Math Expression Evaluator in JavaScript","archived":false,"fork":false,"pushed_at":"2019-02-04T14:36:10.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T07:04:27.029Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeplea.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":"2019-02-04T13:52:01.000Z","updated_at":"2021-03-04T12:38:12.000Z","dependencies_parsed_at":"2023-03-13T13:54:53.340Z","dependency_job_id":null,"html_url":"https://github.com/codeplea/rimath","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"055fae68d9abdf85a2702084205753142c37e70b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codeplea/rimath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplea%2Frimath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplea%2Frimath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplea%2Frimath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplea%2Frimath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeplea","download_url":"https://codeload.github.com/codeplea/rimath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeplea%2Frimath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000988,"owners_count":26082971,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-12T06:23:05.043Z","updated_at":"2025-10-09T07:06:53.152Z","avatar_url":"https://github.com/codeplea.png","language":"JavaScript","readme":"\n# RiMath\n\nRiMath is a small math expression evaluator in JavaScript. It uses the\n[shunting-yard\nalgorithm](https://en.wikipedia.org/wiki/Shunting-yard_algorithm) to convert\nexpressions to [Reverse Polish\nNotation](https://en.wikipedia.org/wiki/Reverse_Polish_notation).\n\nThis code is battle-tested and has been in use since 2013 at [Turnkey\nTelemetry](https://turnkeytelemetry.com/), both server-side and client-side.\n\n## Installation\n\nIf using Node.js, you can easily install with npm:\n\n```\nnpm install rimath\n```\n\nOtherwise, just copy `rimath.js` into your project. It also works fine\nclient-side.\n\n\n## Example Usage\n\n```\nvar rimath = require('./rimath.js');\n\n\n//Basic usage\nvar expr = rimath.compile(\"100+5*2\");\nconsole.log(expr()); //110\n\n\n//Call external function\nvar triple = function(s) {s.push(s.pop()*3);};\nvar funcs = {trip: [1, triple]};\nexpr = rimath.compile(\"trip(100)\", funcs);\nconsole.log(expr()); //300\n\n\n\n//Detect error (unbalanced paran)\nexpr = rimath.compile(\"1+(4*2\");\nconsole.log(expr); //{text: '1+(4*2', index: 6, token: '', type: 'paren'}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeplea%2Frimath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeplea%2Frimath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeplea%2Frimath/lists"}