Compare two saved HAR-style JSON exports to see which request costs changed. It reads local evidence only; it does not fetch a URL, drive a browser, replay a request, or infer what a live site would do. This is useful when a build changes request count, total timing, transferred body size, captured cache policy or an explicitly supplied critical dependency.
This walkthrough uses the tool's public README and checked-in example files. Run the command from a repository checkout with Node.js 22+; inspect the source before using it on your own files.
Run the checked-in example
npm run example:pass # equivalent requests in different order; exit 0
npm run example:fail # synthetic regressions; exit 1
node bin/network-waterfall-diff.mjs --root exports \
--before before.har.json --after after.har.json \
--timing-budget-ms 5 --size-budget-bytes 1024 \
--report comparison.json
npm run checkRead the result
The two input paths and optional report path are resolved beneath --root (default: the working directory). Each input's real path must remain in the root. --report writes JSON byte-identical to stdout, but only after the output passes the destination guard. The input files are never modified.
Where this check stops
The input is a document somebody exported, not a live performance measurement. The tool does not verify a body payload, actual cache hit, service-worker behavior, browser priority, TLS connection reuse, criticality not supplied in edilec, or causal dependence not declared there. It never mutates an input, changes a cache policy, connects to a host, or loads a third-party package. Use a fresh, complete capture on both sides before treating a reported delta as an explanation of user-visible performance.
Before adapting the command to your own workflow, review the accepted inputs, exit codes and safety boundaries in the README.
Compiled with AI assistance from checked-in public documentation and example scripts. Run the example and review the repository's current documentation before relying on its result.