{"id":15605847,"url":"https://github.com/dqbd/ts-math-evaluate","last_synced_at":"2025-10-18T01:07:42.387Z","repository":{"id":152789362,"uuid":"569776081","full_name":"dqbd/ts-math-evaluate","owner":"dqbd","description":"Type-level math expression evaluator for TypeScript.","archived":false,"fork":false,"pushed_at":"2023-06-05T15:05:27.000Z","size":13904,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-29T03:12:18.599Z","etag":null,"topics":["math","parser","type-level-programming","typescript"],"latest_commit_sha":null,"homepage":"https://ts-math-evaluate.vercel.app/","language":"TeX","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/dqbd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2022-11-23T15:32:56.000Z","updated_at":"2024-11-08T09:59:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"85a701ad-eb2d-46f3-8102-7249f0750323","html_url":"https://github.com/dqbd/ts-math-evaluate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dqbd%2Fts-math-evaluate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dqbd%2Fts-math-evaluate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dqbd%2Fts-math-evaluate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dqbd%2Fts-math-evaluate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dqbd","download_url":"https://codeload.github.com/dqbd/ts-math-evaluate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232098370,"owners_count":18472318,"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","parser","type-level-programming","typescript"],"created_at":"2024-10-03T04:17:16.998Z","updated_at":"2025-10-18T01:07:37.339Z","avatar_url":"https://github.com/dqbd.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"![TS-Math-Evaluate](https://raw.githubusercontent.com/dqbd/ts-math-evaluate/main/assets/cover.svg)\n\n# TS-Math-Evaluate\n\n`ts-math-evaluate` is a type-level library for evaluating mathematical expressions in TypeScript, developed as a master thesis, implementing core mathematical operations and the accompanying evaluator, demonstrating the power of the TypeScript type system and the ability to perform complex meta-programming within the type system itself. \n\nAlongside the evaluator, the expression parser and the accompanying parser generator can accept any LL(1) grammar and can be used to parse more complex formats, such as JSON. Finally, a benchmarking tool is provided, which can be used to benchmark any type-level code in isolation, keeping all the test cases in a single file.\n\nA comprehensive guide to the TypeScript syntax and type-level programming techniques is provided to broaden the understanding of the capabilities of this language, seen [here (ctufit-thesis.pdf)](https://github.com/dqbd/ts-math-evaluate/blob/c7e71ed156ba0349e658ae805684cf46ecdc744d/thesis/ctufit-thesis.pdf). \n\n## Installation\n\n```bash\nnpm install ts-math-evaluate\n```\n\n## Usage\n\n```typescript\nimport type { Evaluate } from \"ts-math-evaluate\"\n\ntype Basic = Evaluate\u003c\n  \"3.1 + 2.5 * (1 - 5.6) / 4.2\"\n\u003e\n\ntype Advanced = Evaluate\u003c\n  \"truncate(root(4, 2))! * -floor(1.5) + abs(-1) + ceil(root(4, 2))\"\n\u003e\n```\n\nFor full documentation, please visit [https://ts-math-evaluate.vercel.app/](https://ts-math-evaluate.vercel.app/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdqbd%2Fts-math-evaluate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdqbd%2Fts-math-evaluate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdqbd%2Fts-math-evaluate/lists"}