{"id":22729979,"url":"https://github.com/ben-sb/jisu","last_synced_at":"2025-08-08T02:18:49.798Z","repository":{"id":49500894,"uuid":"508392300","full_name":"ben-sb/jisu","owner":"ben-sb","description":"JavaScript Parser","archived":false,"fork":false,"pushed_at":"2024-09-16T15:47:44.000Z","size":469,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T23:15:03.462Z","etag":null,"topics":["javascript","parser","tokeniser"],"latest_commit_sha":null,"homepage":"https://ben-sb.github.io/jisu/","language":"TypeScript","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/ben-sb.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":"2022-06-28T17:21:04.000Z","updated_at":"2025-01-16T01:00:35.000Z","dependencies_parsed_at":"2024-09-16T19:04:02.822Z","dependency_job_id":"27f1179a-4c6a-4fce-9351-9da16e17e3e6","html_url":"https://github.com/ben-sb/jisu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ben-sb/jisu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjisu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjisu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjisu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjisu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben-sb","download_url":"https://codeload.github.com/ben-sb/jisu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben-sb%2Fjisu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269352013,"owners_count":24402703,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","parser","tokeniser"],"created_at":"2024-12-10T18:12:47.898Z","updated_at":"2025-08-08T02:18:49.770Z","avatar_url":"https://github.com/ben-sb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JISU\n\nA work in progress JavaScript tokeniser and parser. Currently only supports a subset of the JavaScript language and is not ECMAScript compliant.\n\nInstall via `npm install jisu`\n\nAn online demo is available at https://ben-sb.github.io/jisu\n\n## About\nJISU is *mostly* a recursive descent parser. It uses the bottom-up [precedence climbing method](https://en.wikipedia.org/wiki/Operator-precedence_parser) to parse binary and logical expressions.\n\n## Specs\nThe repo has two exports:\n* **parse** - Parses a full program\n* **parseExpression** - Parses a single expression\n\nBoth take the input as a string and optionally a set of parser options.\n```typescript\ninterface ParserOptions {\n    emitLogs?: boolean;\n    omitLocations?: boolean;\n}\n```\n\nI'm a big fan of [Babel](https://github.com/babel/babel) and as a result the format of the AST JISU produces is extremely similar to Babel's. As a result @babel/generator can be used on the AST (as seen in *src/demo.ts*). I also took inspiration from the @babel/types package and implemented a similar system in *src/parser/ast*.\n\n## Tests\nUnit tests can be run via ```npm test```\u003cbr/\u003e\nCurrently there are very few tests but I plan to add more.\n\n## To Do\n* Rewrite object member parsing\n* Allow semi-keywords (e.g. await, async, of) to be treated as identifiers\n* Support numbers expressed in hexadecimal, octal and scientific notation\n* Support regular expressions\n* Probably a lot more\n\n## To Fix\n* Object patterns are treated as normal object expressions even when not used as a pattern\n* Spread elements are allowed in sequence expressions\n* Spread elements are allowed on their own in parenthesised expressions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-sb%2Fjisu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben-sb%2Fjisu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben-sb%2Fjisu/lists"}