{"id":22882679,"url":"https://github.com/nimitzdev/logical-expression-parser","last_synced_at":"2025-05-07T04:48:57.536Z","repository":{"id":45030666,"uuid":"160671884","full_name":"NimitzDEV/logical-expression-parser","owner":"NimitzDEV","description":"Logical expression parser written in JavaScript","archived":false,"fork":false,"pushed_at":"2023-04-21T16:35:16.000Z","size":10,"stargazers_count":22,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T04:48:50.283Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NimitzDEV.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":"2018-12-06T12:29:43.000Z","updated_at":"2025-02-07T09:50:59.000Z","dependencies_parsed_at":"2024-06-19T05:26:16.697Z","dependency_job_id":"0ea3c465-5727-46a4-90eb-1e6aa5bc751b","html_url":"https://github.com/NimitzDEV/logical-expression-parser","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/NimitzDEV%2Flogical-expression-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimitzDEV%2Flogical-expression-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimitzDEV%2Flogical-expression-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NimitzDEV%2Flogical-expression-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NimitzDEV","download_url":"https://codeload.github.com/NimitzDEV/logical-expression-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816521,"owners_count":21808702,"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-12-13T18:19:02.088Z","updated_at":"2025-05-07T04:48:57.514Z","avatar_url":"https://github.com/NimitzDEV.png","language":"JavaScript","readme":"# Logical Expression Parser\n\n[![npm version](https://badge.fury.io/js/logical-expression-parser.svg)](https://badge.fury.io/js/logical-expression-parser)\n\nThis is a logical expression parser for JavaScript, it can parse a logical expression into a AST object and evaluates the result using your token checking function.\n\n## Supported logical operators\n1. `|` Or\n1. `\u0026` And\n1. `!` Not\n1. `()` Parentheses\n\n## How it works\n1. The parser parse and tokenize the expression, for example one of your function requires `REGISTED\u0026(SPECIAL|INVITED)`\n1. Parser then will pass `REGISTED`, `SPECIAL` and `INVITED` into your token checking function to get a boolean result\n1. Finaly the parser will evaluates the final result\n\n## Example\n```javascript\nconst LEP = require('logical-expression-parser');\n\nconst REQUIREMENTS = 'REGISTED\u0026(SPECIAL|INVITED)';\nconst LIST_A = ['REGISTED', 'INVITED'];\nconst LIST_B = ['SPECIAL', 'EXPERT'];\n\nconst RESULT_A = LEP.parse(REQUIREMENTS, t =\u003e LIST_A.indexOf(t) \u003e -1);\nconst RESULT_B = LEP.parse(REQUIREMENTS, t =\u003e LIST_B.indexOf(t) \u003e -1);\n\n// RESULT_A: true\n// RESULT_B: false\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimitzdev%2Flogical-expression-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimitzdev%2Flogical-expression-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimitzdev%2Flogical-expression-parser/lists"}