To utilize the harx
command in your Terminal, you first must install it globally.
pnpm i -g harx
yarn global add harx
As long as $(yarn global dir)
or pnpm's global dir is in your system's $PATH
var, you can run harx
directly:
USAGE
$ harx <file> [options]
OPTIONS
-o, --output [path] Output path to extract files (default is ./output)
-i, --include [pattern] RegExp pattern: extract matching files, unless excluded
-e, --exclude [pattern] RegExp pattern: skips matching files, unless included
-n, --no-query Strip the URL query string from file paths
-d, --dry-run Do not persist any lasting changes. For testing.
-v, --verbose Be more talkative
-h, --help Displays this help page
--version Displays the current harx version
EXAMPLES
# extracts everything to /path/to/out/net
harx ./net.har --output /path/to/output
# includes only .html files
harx archive.har --exclude "*" --include "*.html"
# excludes only .js files
harx archive.har --include "*" --exclude "*.js"
-o, --output [path] Output path for extracted files (default is ./output)
-i, --include [pattern] RegExp pattern: extract matching files, unless excluded
-e, --exclude [pattern] RegExp pattern: skips matching files, unless included
-n, --no-query Strip the URL query string from file paths
-d, --dry-run Don't persist any lasting changes. For testing.
-v, --verbose Be more talkative
Note: if you get an error stating
harx cannot be found
or similar, try to runpnpx harx
ornpx harx
instead.
# extracts HTTP snapshot into "./output/nberlette.github.io" subfolder
# includes all images, fonts, styles, and HTML files that DevTools
# recorded in the Network log before you exported the HAR file.
harx ./nberlette.github.io.har -o ./output --no-query
harx ./archive.org.har --exclude "*" --include "*.html" --include "*.css"
harx ./archive.har -o images -e "*" -i "*.png"
If you'd like to simply examine what files would be extracted, without actually writing to the file system...
harx ./archive.har --output output --dry-run --verbose
- HAR 1.2 Spec | Software is hard
- HTTP Archive (HAR) format
- micmro/har-format-ts-declaration: TypeScript typing for HAR (HTTP Archive) 1.2
MIT © 2022 Nicholas Berlette • Inspired by azu