{"id":24745913,"url":"https://github.com/PotatoMaster101/WpkSnoop","last_synced_at":"2025-10-10T13:32:27.433Z","repository":{"id":273717911,"uuid":"920652467","full_name":"PotatoMaster101/WpkSnoop","owner":"PotatoMaster101","description":"A .NET tool that searches and extracts Webpack chunk loaders from JS files","archived":false,"fork":false,"pushed_at":"2025-04-28T06:00:34.000Z","size":215,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T22:00:00.486Z","etag":null,"topics":["dotnet","webpack","webpack-chunk","webpack-chunk-loader","webpack-tool"],"latest_commit_sha":null,"homepage":"","language":"C#","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/PotatoMaster101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-22T14:39:03.000Z","updated_at":"2025-04-28T06:00:37.000Z","dependencies_parsed_at":"2025-04-12T17:25:12.873Z","dependency_job_id":"0d42beab-23f9-4e3c-a591-2bc9d6c67c27","html_url":"https://github.com/PotatoMaster101/WpkSnoop","commit_stats":null,"previous_names":["potatomaster101/chunk-search","potatomaster101/webpack-chunk-extract","potatomaster101/wpksnoop"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PotatoMaster101/WpkSnoop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2FWpkSnoop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2FWpkSnoop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2FWpkSnoop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2FWpkSnoop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PotatoMaster101","download_url":"https://codeload.github.com/PotatoMaster101/WpkSnoop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PotatoMaster101%2FWpkSnoop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004062,"owners_count":26083667,"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-10-10T02:00:06.843Z","response_time":62,"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":["dotnet","webpack","webpack-chunk","webpack-chunk-loader","webpack-tool"],"created_at":"2025-01-28T03:30:04.107Z","updated_at":"2025-10-10T13:32:27.428Z","avatar_url":"https://github.com/PotatoMaster101.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: GPLv3](https://img.shields.io/badge/license-GPLv3-blue)](https://opensource.org/license/gpl-3-0)\n[![CI](https://github.com/PotatoMaster101/WpkSnoop/actions/workflows/dotnet.yml/badge.svg)](https://github.com/PotatoMaster101/WpkSnoop/actions/workflows/dotnet.yml)\n\n# WpkSnoop\nA .NET tool that searches and extracts Webpack chunk loaders from `.js` files.\n\nThe extractor supports:\n- Chunk loader that uses an object expression (e.g., `{100: \"chunk1\", 101: \"chunk2\"}[e] + \".js\"`)\n- Chunk loader that uses `if` statements (e.g., `if (100 === e) return \"chunk.js\"`)\n- Chunk loader that uses ternary operator (`?:`) (e.g., `100 === e ? \"chunk.js\" : ...`)\n- Chunk loader that uses `switch` statement (e.g., `switch (e) { case 100: return \"chunk.js\" }`)\n- Chunk loader that uses array lookup (e.g., `[\"chunk1.js\", \"chunk2.js\"][e]`)\n\nFor an overview of how this works read [DOC.md](DOC.md).\n\n**Note**: I don't intend to continue developing this tool any further, as there are better alternatives available, such as [jxscout](https://github.com/francisconeves97/jxscout). This project began as a research experiment to explore chunk detection algorithms, and it's reached its conclusion.\n\n## Building\nBuild with [.NET](https://dotnet.microsoft.com/en-us/).\n```\ndotnet publish src/WpkSnoop.Cli/WpkSnoop.Cli.csproj -c Release -o .\n```\nYou might receive some JINT warning when compiling as native AOT but the tool seems to work fine after some testing.\n\n## Usage\n```\nDescription:\n  Webpack Chunk Loader Extractor\n\nUsage:\n  wpksnoop \u003cpath\u003e [options]\n\nArguments:\n  \u003cpath\u003e  Path to the JS file containing the chunk loader\n\nOptions:\n  -d, --dir                Specifies that the path is a directory path\n  -v, --verbose            Specifies verbose output\n  -H, --header \u003cheader\u003e    Specifies the HTTP headers for chunk file GET requests\n  -D, --domain \u003cdomain\u003e    Specifies the base URL for chunk file GET requests\n  -x, --proxy \u003cproxy\u003e      Specifies the proxy URL for chunk file GET requests\n  -k, --insecure           Specifies to not validate HTTPS certificates for chunk file GET requests\n  -t, --threads \u003cthreads\u003e  Specifies the number of threads to use [default: 2147483647]\n  --version                Show version information\n  -?, -h, --help           Show help and usage information\n```\n\n## Examples\nSample JS files can be found under `tests/WpkSnoop.Core.Test/Samples/`. They are used to test different chunk loaders generated by Webpack.\n\n### Single `.js` File\n```\nwpksnoop tests/WpkSnoop.Core.Test/Samples/small.js\n```\n\n### Directory With `.js` Files\n```\nwpksnoop -d tests/WpkSnoop.Core.Test/Samples/\n```\n\n### Sending GET Requests\nUsed to send all the found chunk loader entries to a site.\n```\nwpksnoop tests/WpkSnoop.Core.Test/Samples/small.js -D 'https://example.com/chunks/'\n```\n\nThe chunk loader entries can also go through a proxy, useful for using tools like burp.\n```\nwpksnoop tests/WpkSnoop.Core.Test/Samples/small.js -v -D 'https://example.com/chunks/' -x 'http://localhost:8080'\n```\n\nHTTP headers can be added by using `-H`.\n```\nwpksnoop tests/WpkSnoop.Core.Test/Samples/small.js -v -D 'https://example.com/chunks/' -H 'Cookie: 1' -H 'Cookie: 2'\n```\n\n## Generate Webpack Files\nSample Webpack project used for testing can be found under `webpack/`. Generate Webpack files by:\n```\ncd webpack\nnpm install\nnpm run build\n```\nThe generated Webpack files will be under `webpack/dist/`.\n\n## Limitations\nSee [issues](https://github.com/PotatoMaster101/WpkSnoop/issues?q=is%3Aissue%20state%3Aopen%20author%3APotatoMaster101).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPotatoMaster101%2FWpkSnoop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPotatoMaster101%2FWpkSnoop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPotatoMaster101%2FWpkSnoop/lists"}