Contributing to JS Recon Tool
Reporting Bugs
If you find an issue with the tool, please create a new issue on GitHub here.
Requesting new support for new technologies
If the tool doesn't support a framework and you want the tool to support it, please create a new issue on GitHub here.
Contributing to the codebase
Setting the dev environment
First of all, clone the repository:
git clone https://github.com/js-recon/js-recon.git
cd js-recon
npm install
The tool supports Node.js v22.17.0 (LTS) or later with npm as the package manager. You can download it from here.
How the codebase is structured
First of all, these three npm scripts would be helpful:
npm run build # build the tool
npm run start # run the tool in production mode
npm run cleanup # remove all the output files of tool and build the tool again
All the code for this tool is written in TypeScript, and is under the src/ directory. The file index.ts is the entry point of the tool. It contains all the CLI arguments for the tool, and executes the responsible functions.
The code for the modules is stored in directories inside the src/ directory, except for the utility directory.
The directories for the modules contain a file index.ts, which is the entry point for the module.
Testing is required for new functionality
Every new feature or fix should ship with tests:
- Unit tests (Vitest) for pure functions — anything that takes plain
inputs and returns a value without I/O (parsing, string extraction, URL resolution, etc.). Live in
src/__tests__/<component>/<name>.test.ts, run withnpm test. Puppeteer, network calls, and file writes are intentionally left untested at the unit level — validate those end-to-end via therunsubcommand instead. - Fuzz tests (fast-check) for anything on the untrusted-input
boundary — js-recon parses JS bundles pulled from third-party targets, so functions that parse or
transform that raw text should get a property-based fuzz test in addition to example-based unit
tests. Named
<name>.fuzz.test.ts, run separately withnpm run test:fuzz(excluded from the defaultnpm testrun since they're slower). - Smoke tests for new rules — the
rules-smoke-testCI workflow runs js-recon end-to-end against a seeded lab app (js-recon-labs) and asserts every expected rule fires. Adding a rule tojs-recon-rulesmeans seeding the corresponding vulnerability in the lab app and adding the rule ID toEXPECTED_RULESinjs-recon'sscripts/smoke-test.js.
See contributing/testing.md
in the js-recon repo for the full write-up, including how to construct Babel AST nodes in tests and
how to avoid tripping GitHub's secret scanner on test fixtures that look like real credentials.
Keep the docs in sync
If your change affects user-facing behavior, CLI flags, exit codes, or install/usage instructions,
include a corresponding update to this docs site (js-recon-docs) — either in the same pull request
cycle or a linked follow-up PR. Docs-only fixes don't require a corresponding js-recon change.
Static analysis
CI runs ESLint (with eslint-plugin-security) and
CodeQL on every push and pull request to js-recon. Run npm run lint
locally before pushing.
Making a Pull Request
- Fork the repo
- Create a new branch from the
devbranch
git checkout -b <your-feature-name> dev
- Commit your changes with meaningful commit messages
git add <files>
git commit -m "[feat/chore/fix/docs]: <meaningful commit message>"
- Push your branch
git push origin <your-feature-name>
-
Open a pull request to the
devbranch -
When the PR is created, make sure that all the checks pass. If any of the checks fail, fix the issues and push the changes again.
-
Once all the tests pass, the changes will be reviewed by the maintainers. If the changes are accepted, they will be merged into the
devbranch. -
The changes will be available in the next release of the tool.
-
If you want to contribute to the docs, please create a new pull request on GitHub here.