@vegardit/har-extract v2.0.1
node-har-extract
What is it?
Extract response bodies from http archives (.har).
Usage?
const extract = require('@vegardit/har-extract');
extract({ outputDir: 'tmp', inputFile: 'my-test-file.har' }).then((result) => {
const { outputDir, harFile } = result;
console.log('response bodies are extracted to %d', outputDir);
console.log('the reduced new har file can be found at %d', harFile);
})Options
outputDir(optional), default:outputabsolute or relative path to write extracted content to. Any provided path is run through make-dir to ensure it's existence. Relative paths are coerced throughpath.resolve(outputDir), which will resolve an absolute path fromprocess.cwd().inputFile(required): absolute or relative path to http archive file. File content is loaded and (ifvalidateInputis truthy) validated through har-validator to ensure compliance with HAR 1.2 spec. Also,inputFilemust not be nested withinoutputDir.validateInput(optional), default:falseturn on / off validation ofinputFilecontent through har-validator. (this currently leads to validation errors whenipv6addresses are listed inentries[].serverIPAddress, hence the default isfalse)
License
All files are released under the Apache License 2.0.