{"id":20594351,"url":"https://github.com/srijan-paul/jam","last_synced_at":"2025-04-06T04:08:38.153Z","repository":{"id":258251315,"uuid":"872568944","full_name":"srijan-paul/jam","owner":"srijan-paul","description":"Fast and effective parser, formatter, code optimizer, and linter for the JS ecosystem","archived":false,"fork":false,"pushed_at":"2025-03-29T16:26:16.000Z","size":4406,"stargazers_count":114,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T17:28:40.035Z","etag":null,"topics":["javascript","linter","toolchain","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srijan-paul.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":"2024-10-14T17:02:23.000Z","updated_at":"2025-03-29T16:26:19.000Z","dependencies_parsed_at":"2024-11-15T18:26:07.490Z","dependency_job_id":"a378cd81-2c74-4904-b188-04ba6437877c","html_url":"https://github.com/srijan-paul/jam","commit_stats":null,"previous_names":["srijan-paul/jam"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srijan-paul%2Fjam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srijan-paul%2Fjam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srijan-paul%2Fjam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srijan-paul%2Fjam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srijan-paul","download_url":"https://codeload.github.com/srijan-paul/jam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430868,"owners_count":20937874,"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":["javascript","linter","toolchain","zig"],"created_at":"2024-11-16T08:08:40.755Z","updated_at":"2025-04-06T04:08:35.670Z","avatar_url":"https://github.com/srijan-paul.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jam\n\nA high-performance JavaScript toolchain + analyzer built from the ground up.\n**Work in progress!**\n\nJam is a JavaScript parser, linter, formatter, printer and vulnerability scanner.\n\n## Goals\n\n- Competitive in performance with existing tools. \n- Support JS, JSX, and TypeScript out of the box.\n    - And the `\u003cscript\u003e` part of VueJS code.\n- Single, small binary.\n- Support data flow analysis and call-graphs with an accessible API. \n- Expose a capable parsing and scope resolution, such that a bundler, minifier, etc., can be built on top of it.\n- API to write lint rules with zig.\n- Custom JavaScript plugins.\n\n## Roadmap\n\n- Phase 1:\n    - [x] A fast, 100% Spec compliant JavaScript parser.\n    - [x] Port [ESLint scope](https://github.com/eslint/js/tree/main/packages/eslint-scope) to Zig\n    - [ ] Semantic analysis: Control Flow Graphs (**WIP**).\n    - [ ] JSX support (**WIP**)\n    - [ ] TypeScript support in the parser.\n    - [ ] Runtime for a linter, with Zig plugin support.\n    - [ ] Formatter with a **language agnostic backend**.\n- Alpha release\n    - [ ] Simple linter with all the base rules from ESLint.\n    - [ ] A prototype for the jam formatter\n- Beta release\n    - [ ] Data flow analysis and taint checking\n\n\n## Local development\n\nI've tried to keep the development process hassle-free.\nYou need only a Zig compiler (and optionally an environment variable) to get going.\n\nIf you still face any issues, feel free to open an issue\nor reach out to me on discord (`@injuly.`), [twitter](https://x.com/ptrCast), or [e-mail](mailto:srijan@injuly.in).\nI usually respond within a day.\n\n\u003e **NOTE:** If you're willing to contribute, It's a good idea to copy the contents of ./pre-commit to \nyour `./.git/hooks/pre-commit`.\n\u003e This will ensure you didn't break any existing functionality before letting you commit changes.\n\n### Basic setup\n\n1. Ensure you have a `master` build of the zig compiler –\nto seamlessly switch between multiple zig versions, I recommend using [zvm](https://github.com/tristanisham/zvm).\n2. Clone this project into your development machine.\n3. Run `zig build run -- \u003cpath-to-file.js\u003e` to see a parsed AST for the given file.\n4. Run `zig build test` to run the unit tests.\n\n### Checking ECMAScript conformance\n\nTo avoid regressions and keep track of spec compliance, we use a `results.json` and `babel-results.json` file –\ntheir formats are explained in the [tools README](./tools/README.md).\n\nYou'll need to set the `JAM_TESTS_262_DIR` environment variable to the path of a cloned [tc39/test262-parser-tests](https://github.com/tc39/test262-parser-tests) repository:\n\n```sh\ngit clone --depth 1 https://github.com/tc39/test262-parser-tests.git /tmp/test262-parser-tests\n# `tools/ec262-tests` can find the tests if you set the environment variable.\nexport JAM_TESTS_262_DIR=/tmp/test262-parser-tests\n```\n\nTo compare your changes with the existing test results, run `zig build test262 -- compare ./tools/results.json`.\nIf it exits normally, you didn't break anything!\n\nTo update the test results when you increase conformance, run `zig build test262 \u003e ./tools/results.json`.\n\n\nCurrently, the format of the `results.json` file is roughly as follows:\n\n```js\n{\n  // % of test files that either: a) parsed incorrectly, or b) failed to parse.\n  \"fail_percent\": 35.703479576399396,\n  // % of test files that were parsed correctly.\n  \"pass_percent\": 64.2965204236006,\n  // number of test files that parsed but had an incorrect syntax tree.\n  \"unmatching_ast_count\": 17,\n  // results for individual test cases:\n  \"test_cases\": {\n    \"2db5219f0ac5dd71.js\": \"parse_error\",\n    \"c532e126a986c1d4.js\": \"pass\",\n    \"d532e126a986c1d4.js\": \"ast_no_match\",\n    // ...goes on for a few thousand lines...\n```\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrijan-paul%2Fjam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrijan-paul%2Fjam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrijan-paul%2Fjam/lists"}