{"id":16441090,"url":"https://github.com/kdinev/epsilonjs","last_synced_at":"2025-03-23T08:31:57.332Z","repository":{"id":14222661,"uuid":"16929589","full_name":"kdinev/EpsilonJS","owner":"kdinev","description":"A JavaScript calculator and an expression parser.","archived":false,"fork":false,"pushed_at":"2022-04-20T06:35:10.000Z","size":147,"stargazers_count":12,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T19:05:48.534Z","etag":null,"topics":["calculator","expression-evaluator","expression-parser","javascript","typescript"],"latest_commit_sha":null,"homepage":"http://kdinev.github.io/EpsilonJS","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/kdinev.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":"2014-02-17T23:02:03.000Z","updated_at":"2022-04-20T06:35:13.000Z","dependencies_parsed_at":"2022-08-28T16:02:21.622Z","dependency_job_id":null,"html_url":"https://github.com/kdinev/EpsilonJS","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/kdinev%2FEpsilonJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdinev%2FEpsilonJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdinev%2FEpsilonJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kdinev%2FEpsilonJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kdinev","download_url":"https://codeload.github.com/kdinev/EpsilonJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245078067,"owners_count":20557274,"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":["calculator","expression-evaluator","expression-parser","javascript","typescript"],"created_at":"2024-10-11T09:13:46.292Z","updated_at":"2025-03-23T08:31:57.003Z","avatar_url":"https://github.com/kdinev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"EpsilonJS\n=========\n[![Codacy Badge](https://www.codacy.com/project/badge/3d2d4cba93d94dc59cbbad849f7c9fbe)](https://www.codacy.com/public/kdinev/EpsilonJS) [![Build Status](https://travis-ci.org/kdinev/EpsilonJS.svg?branch=master)](https://travis-ci.org/kdinev/EpsilonJS)\n\nEpsilonJS us a JavaScript calculator and an expression parser. The framework allows for parsing mathematical expressions from string or from DOM attributes. It also allows evaluation of mathematical expressions as part of DOM attributes which reference other DOM elements.\n\nYou can get EpsilonJS through Bower:\n\n    bower install epsilonjs\n\nHow to build EpsilonJS\n=========\n\nClone the repo:\n\n    git clone https://github.com/kdinev/EpsilonJS.git\n    \nGo to the EpsilonJS folder and install dependencies:\n\n    cd epsilonjs\n    npm install\n    \nBuild:\n\n    grunt default\n\nDescription\n=========\n\nParses and evaluates mathematical expressions. The expression is provided to the expression parser as a string.\n\n    var expr = \"1/(2+8)*2\",\n        parser = new Epsilon.ExpressionParser(expr);\n    parser.evaluate(); // Yeilds 0.2 as a number type\n    \nSupported operators:\n\n * Addition (+)\n * Subtraction (-)\n * Multiplication (*)\n * Division (/)\n * Negative values (-)\n * Brackets (())\n\nThe epsilon expression parser handles DOM formula references as well. The epsilon expression parser will evaluate all elements containing a `data-formula` attribute. In order to get the DOM evaluated the `Epsilon.epsilon()` method needs to be called after loading the DOM. The references need to be like excel cells (e.g. `A10`, `C2`) and will be looked-up by `id` and by `data-formula-ref` attribute if not found by `id`. The referenced elements can contain and formula and epsilon will evaluate them according to their `data-formula`. Circular references are not handled at this point and will result in out of stack space exception.\n\nExample:\n\n    \u003cul\u003e\n        \u003cli id=\"A1\"\u003e10\u003c/li\u003e \u003c!-- \u003cli data-formula-ref=\"A1\"\u003e10\u003c/li\u003e --\u003e\n        \u003cli data-formula=\"=A1*2\"\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n        Epsilon.epsilon();\n    \u003c/script\u003e\n    \nThe result will be:\n\n * 10\n * 20\n\nEpsilon can evaluate only specific DOM elements as well and can be invoked at any point for those elements. If the reference elements contain formulas, then their formulas will be evaluated as part of the requested element's formula but their DOM values will not be changed.\n\nExample:\n\n    \u003cul\u003e\n        \u003cli id=\"A1\"\u003e10\u003c/li\u003e \u003c!-- \u003cli data-formula-ref=\"A1\"\u003e10\u003c/li\u003e --\u003e\n        \u003cli id=\"A2\" data-formula=\"=A1*2\"\u003e\u003c/li\u003e\n        \u003cli id=\"A3\" data-formula=\"=A2+5\"\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n        Epsilon.epsilon(document.getElementById(\"A3\"));\n    \u003c/script\u003e\n\nThe result will be:\n\n * 10\n * \n * 25\n\n\n======\nThere is also a jQuery UI epsilon calculator widget provided by [https://github.com/kdinev/calculatorjs](https://github.com/kdinev/calculatorjs). This widget was created to test the epsilon expression parser. The calculator widget is dependent on jQuery and jQuery UI. In order to use it:\n    \n    \u003cdiv id=\"calculator\"\u003e\u003c/div\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n\t\t$(document).ready(function () {\n\t\t\t$(\"#calculator\").calculator();\n\t\t});\n\t\u003c/script\u003e\n\nThe calculator widget is used in a Windows 8.1 store application which you may download and play with here: [http://apps.microsoft.com/windows/app/epsilon-calculator/ec41ebdd-00c6-4654-a2a2-b297a0118a87](http://apps.microsoft.com/windows/app/epsilon-calculator/ec41ebdd-00c6-4654-a2a2-b297a0118a87)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdinev%2Fepsilonjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkdinev%2Fepsilonjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkdinev%2Fepsilonjs/lists"}