https://github.com/g-otn/har-to-js-download-snippet
Reads GET requests from HAR file and converts them into JS fetch script
https://github.com/g-otn/har-to-js-download-snippet
code-generation har snippet-generator
Last synced: 3 months ago
JSON representation
Reads GET requests from HAR file and converts them into JS fetch script
- Host: GitHub
- URL: https://github.com/g-otn/har-to-js-download-snippet
- Owner: g-otn
- Created: 2021-06-13T07:19:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-14T02:06:31.000Z (almost 4 years ago)
- Last Synced: 2025-01-17T05:29:12.301Z (4 months ago)
- Topics: code-generation, har, snippet-generator
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# har-to-js-download-snippet
This script reads an HAR file for GET requests and prints their URLs into javascript code.
When the code is executed in the browser, it will fetch the URLs, zip each response data and download the generated zip.## Instructions
Requirements: Git and Node.js
1. Clone the repository:
```bash
git clone https://github.com/g-otn/har-to-js-download-snippet.git
```2. Move your `.har` file to the repository folder and rename it to `file.json`
3. (Optional) Edit the `index.js` file and modify the options at the beggining of the file
- If the `FETCH_LIBS` option is set to `true`, install the dependencies by running: `npm i`4. Run the `index.js` file to generate your snippet:
```bash
node .
```5. The snippet will be generated at `snippet.js`. You can use it by, for example, pasting the file content into the browser console