{"id":21177552,"url":"https://github.com/grjan7/xl-formula-parser","last_synced_at":"2025-06-22T17:07:11.119Z","repository":{"id":119280740,"uuid":"514211389","full_name":"grjan7/xl-formula-parser","owner":"grjan7","description":"Parses excel-formula-like string to JSON object tree and reverse parses to formula string.","archived":false,"fork":false,"pushed_at":"2022-09-27T18:41:10.000Z","size":121,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T17:07:03.652Z","etag":null,"topics":["excel-like","formula","object-tree","parse","parser","stringify"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grjan7.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":"2022-07-15T09:29:16.000Z","updated_at":"2023-07-28T06:53:10.000Z","dependencies_parsed_at":"2023-07-02T23:16:46.399Z","dependency_job_id":null,"html_url":"https://github.com/grjan7/xl-formula-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/grjan7/xl-formula-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grjan7%2Fxl-formula-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grjan7%2Fxl-formula-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grjan7%2Fxl-formula-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grjan7%2Fxl-formula-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grjan7","download_url":"https://codeload.github.com/grjan7/xl-formula-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grjan7%2Fxl-formula-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261330126,"owners_count":23142482,"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":["excel-like","formula","object-tree","parse","parser","stringify"],"created_at":"2024-11-20T17:16:26.153Z","updated_at":"2025-06-22T17:07:06.106Z","avatar_url":"https://github.com/grjan7.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xl-formula-parser\n\n## Description\n\nParses excel-formula-like string to JSON object tree and reverse parses to formula string.\n\n## Installation\n\n```sh\n  npm i xl-formula-parser\n```\n\n## APIs\n\n### parse(str)\n\n- **str** | datatype: string | required \n\n#### Example\n\n```js\n\n  const { parse } = require(\"xl-formula-parser\");\n\n  const formula = `=OR(EQ(./path/personName, \"John Doe\"), NOT(EQ(personName, \"John Smith\")))`;\n\n  parse(formula); \n\n```\n`parse(formula)` returns\n\n```js\n\n  {\n    formula: \"OR\",\n    args: [\n      {\n        formula: \"EQ\", \n        args: [\n          {\n            path: \"./path/personName\"\n          },\n          \"John Doe\"\n        ]\n      },\n      {\n        formula: \"NOT\",\n        args: [\n          {\n            formula: \"EQ\",\n            args:[\n              {\n                variable: \"personName\"\n              },\n            \"John Smith\"\n            ]\n          }\n        ]\n      }\n    ]\n  }\n\n```\n\n------\n\n\n### stringify(obj)\n\n- **obj** | datatype: object | required\n\n\n#### Example\n```js\n\nconst { stringify } = require('xl-formula-parser');\n\nconst formulaTreeObject = {\n    formula: \"OR\",\n    args: [\n      {\n        formula: \"EQ\", \n        args: [\n          {\n            path: \"./path/personName\"\n          },\n          \"John Doe\"\n        ]\n      },\n      {\n        formula: \"NOT\",\n        args: [\n          {\n            formula: \"EQ\",\n            args:[\n              {\n                variable: \"personName\"\n              },\n            \"John Smith\"\n            ]\n          }\n        ]\n      }\n    ]\n  };\n\nstringify(formulaTreeObject);\n\n```\n`stringify(formulaTreeObject)` returns\n\n```js\n\n  '=OR(EQ(./path/personName, \"John Doe\"), NOT(EQ(personName, \"John Smith\")))'\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrjan7%2Fxl-formula-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrjan7%2Fxl-formula-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrjan7%2Fxl-formula-parser/lists"}