Initial commit
This commit is contained in:
15
extract-json-from-har.nu
Executable file
15
extract-json-from-har.nu
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/env nu
|
||||
|
||||
def main [
|
||||
har_file: path,
|
||||
--type: string
|
||||
] {
|
||||
let jsons = (open --raw $har_file | from json | get log.entries.response | where headers.value has "application/json" | get content.text)
|
||||
cd (mktemp -d)
|
||||
mut i = 1;
|
||||
for json in $jsons {
|
||||
$i += 1;
|
||||
$json | save $"($i).json"
|
||||
}
|
||||
open *.json | where type? == $type | to json
|
||||
}
|
||||
Reference in New Issue
Block a user