2.0.1 • Published 4 years ago

@vegardit/har-extract v2.0.1

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
4 years ago

node-har-extract

Build Status Release License

  1. What is it?
  2. Usage
  3. License

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: output absolute 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 through path.resolve(outputDir), which will resolve an absolute path from process.cwd().

  • inputFile (required): absolute or relative path to http archive file. File content is loaded and (if validateInput is truthy) validated through har-validator to ensure compliance with HAR 1.2 spec. Also, inputFile must not be nested within outputDir.

  • validateInput (optional), default: false turn on / off validation of inputFile content through har-validator. (this currently leads to validation errors when ipv6 addresses are listed in entries[].serverIPAddress, hence the default is false)

License

All files are released under the Apache License 2.0.

2.0.1

4 years ago

2.0.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago