There’s --json flag. Hours of googling and trying dozens of packages later, there’s a --json flag. Six characters. ::sigh::
This will dump a machine-readable JSON object containing the complete dependency tree for any given package.json file:
npm install --dry-run --json