Skip to main content
Version: 1.4.4

Report command

The report command generates a report based on the results of the analyze module.

Usage​

js-recon report [options]

Options​

OptionAliasDescriptionDefaultRequired
--sqlite-db <file>-sSQLite database filejs-recon.dbNo
--mapped-json <file>-mMapped JSON fileNo
--analyze-json <file>-aAnalyze JSON fileNo
--endpoints-json <file>-eEndpoints JSON fileNo
--map-openapi, --mapped-openapi-json <file>Mapped OpenAPI JSON fileNo
--output <file>-oOutput file name (without the extension)reportNo
-h, --helpdisplay help for commandNo

Example​

Generate report for mapped JSON file​

js-recon report -m ./mapped.json

Generate report for analyze JSON file​

js-recon report -a ./analyze.json

Generate report for every file​

js-recon report -m mapped.json -a analyze.json -e endpoints.json --map-openapi mapped-openapi.json

Database schema (js-recon.db)​

Alongside report.html, the report command populates a SQLite database (js-recon.db by default, or the path given to --sqlite-db) using better-sqlite3. There is no ORM and no migration system — the schema is created with CREATE TABLE IF NOT EXISTS on every run, and each table is fully rebuilt (with one exception, noted below) from whichever input JSON files were passed to report. Tables for inputs that weren't supplied are simply left empty.

The database has four tables:

mapped​

Populated from mapped.json (one row per function/chunk resolved by the map command).

ColumnTypeNotes
idTEXTPrimary key.
descriptionTEXT
loadedOnTEXTJSON-encoded array.
containsFetchBOOLEANStored as SQLite 0/1.
isAxiosClientBOOLEANStored as SQLite 0/1.
exportsTEXTJSON-encoded array.
callStackTEXTJSON-encoded array.
codeTEXTSource code of the function/chunk.
importsTEXTJSON-encoded array.
fileTEXTPath of the file the entry was extracted from.

Rows are cleared (DELETE FROM mapped) before each run's insert.

mapped_openapi​

Populated from mapped-openapi.json (one row per path + method combination).

ColumnTypeNotes
pathTEXTPart of the composite primary key.
methodTEXTPart of the composite primary key.
summaryTEXTNullable.
parametersTEXTJSON-encoded, nullable.
requestBodyTEXTJSON-encoded, nullable.
tagsTEXTJSON-encoded, nullable.

Primary key: (path, method). Unlike the other three tables, rows here are upserted (INSERT OR REPLACE) rather than cleared first — a prior run's rows for paths/methods no longer present in the current mapped-openapi.json are not removed.

endpoints​

Populated from endpoints.json (client-side route tree extracted by the endpoints command, flattened to full URLs).

ColumnTypeNotes
urlTEXTPrimary key.

Rows are cleared (DELETE FROM endpoints) before each run's insert; duplicate URLs are ignored (INSERT OR IGNORE).

analysis_findings​

Populated from analyze.json (one row per rule finding produced by the analyze command).

ColumnTypeNotes
ruleIdTEXT
ruleNameTEXT
ruleTypeTEXT
ruleDescriptionTEXT
ruleAuthorTEXT
ruleTechTEXTComma-joined if the rule targets multiple technologies.
severityTEXT
messageTEXT
findingLocationTEXT

No primary key or other constraints. Rows are cleared (DELETE FROM analysis_findings) before each run's insert.