{"id":19952637,"url":"https://github.com/qxip/pipemath","last_synced_at":"2026-05-14T19:05:51.972Z","repository":{"id":57324803,"uuid":"374737419","full_name":"QXIP/pipeMath","owner":"QXIP","description":"TinyMath fork spooning with pipeLion","archived":false,"fork":false,"pushed_at":"2021-06-07T16:52:31.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T11:38:01.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QXIP.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":"2021-06-07T16:47:10.000Z","updated_at":"2021-06-07T16:52:34.000Z","dependencies_parsed_at":"2022-09-04T12:52:32.503Z","dependency_job_id":null,"html_url":"https://github.com/QXIP/pipeMath","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/QXIP%2FpipeMath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FpipeMath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FpipeMath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FpipeMath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QXIP","download_url":"https://codeload.github.com/QXIP/pipeMath/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241381645,"owners_count":19953751,"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":"2024-11-13T01:13:56.330Z","updated_at":"2026-05-14T19:05:51.927Z","avatar_url":"https://github.com/QXIP.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pipeMath: Tinymath fork spooning with pipeLion\n\n[![Apache License](https://img.shields.io/badge/license-apache_2.0-a9215a.svg)](https://raw.githubusercontent.com/qxip/pipemath/master/LICENSE)\n[![npm](https://img.shields.io/npm/v/pipemath.svg)](https://www.npmjs.com/package/pipemath)\n\nTinymath is a tiny arithmetic and function evaluator for simple numbers and arrays. Named properties can be accessed from an optional scope parameter and new functions can be added without rebuilding. Enjoy.\n\n**NOTE:** Tinymath requires an ES6 or newer environment. You can use it with your build system of choice to run in older environments.\n\nSee [Function Documentation](/docs/functions.md) for details on built-in functions available in Tinymath.\n\n```javascript\nimport { evaluate } from tinymath\n\n// Simple math\nevaluate('10 + 20'); // 30\nevaluate('round(3.141592)') // 3\n\n// Named properties\nevaluate('foo + 20', {foo: 5}); // 25\n\n// Arrays\nevaluate('bar + 20', {bar: [1, 2, 3]}); // [21, 22, 23]\nevaluate('bar + baz', {bar: [1, 2, 3], baz: [4, 5, 6]}); // [5, 7, 9]\nevaluate('multiply(bar, baz) / 10', {bar: [1, 2, 3], baz: [4, 5, 6]}); // [0.4, 1, 1.8]\n```\n\n### Adding Functions\n\nFunctions can be injected, and built in function overwritten, via the 3rd argument to `evaluate`:\n\n```javascript\nimport { evaluate } from tinymath\n\nevaluate('plustwo(foo)', {foo: 5}, {\n    plustwo: function(a) {\n        return a + 2;\n    }\n}); // 7\n```\n\n### Parsing\n\nYou can get to the parsed AST by importing `parse`\n\n```javascript\nimport { parse } from tinymath\n\nparse('1 + random()')\n/*\n{\n   \"name\": \"add\",\n   \"args\": [\n      1,\n      {\n         \"name\": \"random\",\n         \"args\": []\n      }\n   ]\n}\n*/\n```\n\n#### Notes\n\n* Floating point operations have the normal Javascript limitations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Fpipemath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqxip%2Fpipemath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Fpipemath/lists"}