{"id":29548878,"url":"https://github.com/helkyle/tiny-eval","last_synced_at":"2025-07-17T22:38:15.450Z","repository":{"id":304425156,"uuid":"1018780374","full_name":"HelKyle/tiny-eval","owner":"HelKyle","description":"A tiny and safe eval written in TypeScript","archived":false,"fork":false,"pushed_at":"2025-07-13T03:14:04.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T03:38:41.982Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/HelKyle.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,"zenodo":null}},"created_at":"2025-07-13T03:06:13.000Z","updated_at":"2025-07-13T03:06:20.000Z","dependencies_parsed_at":"2025-07-13T03:50:01.763Z","dependency_job_id":null,"html_url":"https://github.com/HelKyle/tiny-eval","commit_stats":null,"previous_names":["helkyle/tiny-eval"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/HelKyle/tiny-eval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelKyle%2Ftiny-eval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelKyle%2Ftiny-eval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelKyle%2Ftiny-eval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelKyle%2Ftiny-eval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HelKyle","download_url":"https://codeload.github.com/HelKyle/tiny-eval/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelKyle%2Ftiny-eval/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265672399,"owners_count":23808849,"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":[],"created_at":"2025-07-17T22:38:12.636Z","updated_at":"2025-07-17T22:38:15.444Z","avatar_url":"https://github.com/HelKyle.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tiny-eval\n\n\u003cb\u003eA tiny, safe, and elegant arithmetic expression evaluator for TypeScript/JavaScript\u003c/b\u003e\n\n---\n\n## ✨ Features\n\n- **Tiny**: Minimal dependencies, fast and lightweight\n- **Safe**: No use of `eval`, parses and evaluates expressions securely\n- **TypeScript-first**: Written in TypeScript, with full type definitions\n\n---\n\n## 📦 Installation\n\n```bash\npnpm install tiny-eval\n```\n\n---\n\n## 🚀 Usage\n\n```ts\nimport { evaluate } from 'tiny-eval'\n\nconsole.log(evaluate('1 + 2 * 3')) // 7\nconsole.log(evaluate('(1 + 2) * 3')) // 9\nconsole.log(evaluate('0.1 + 0.2')) // 0.3\n```\n\n---\n\n## 🧪 Examples\n\n```ts\n// Basic operations\nevaluate('1+2')            // 3\nevaluate('5-3')            // 2\nevaluate('4*2')            // 8\nevaluate('8/2')            // 4\n\n// Operator precedence\nevaluate('2+3*4')          // 14\nevaluate('2*3+4')          // 10\n\n// Parentheses\nevaluate('(2+3)*4')        // 20\nevaluate('2*(3+4)')        // 14\nevaluate('((1+2)*3)+4')    // 13\n\n// Decimals\nevaluate('0.1+0.2')        // 0.3\nevaluate('1.5*2')          // 3\n\n---\n\n## 🧑‍💻 Testing\n\n```bash\npnpm test\n```\n\n---\n\n## 📄 License\n\nMIT License © 2025 HelKyle\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelkyle%2Ftiny-eval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelkyle%2Ftiny-eval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelkyle%2Ftiny-eval/lists"}