{"id":17663837,"url":"https://github.com/marksmurphy/shrink-har","last_synced_at":"2026-02-16T01:43:48.222Z","repository":{"id":57702333,"uuid":"494404773","full_name":"markSmurphy/shrink-har","owner":"markSmurphy","description":"HTTP Archive files can be large when they contain multiple response bodies. If this content is superfluous to your debugging needs then `shrink-har` allows you create smaller copies of .har files with the response body content stripped out.","archived":false,"fork":false,"pushed_at":"2024-06-22T03:30:41.000Z","size":432,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T20:33:25.991Z","etag":null,"topics":["archive","devtools","har","http","https","reduce","shrink"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/shrink-har","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markSmurphy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-20T09:37:54.000Z","updated_at":"2022-06-11T16:23:22.000Z","dependencies_parsed_at":"2024-06-22T15:39:45.600Z","dependency_job_id":"ab655050-c3ad-4f6e-9730-3a5a8d6c533e","html_url":"https://github.com/markSmurphy/shrink-har","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"60bbac1566d74e4e886b8a6b66db8273a335dce9"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fshrink-har","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fshrink-har/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fshrink-har/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markSmurphy%2Fshrink-har/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markSmurphy","download_url":"https://codeload.github.com/markSmurphy/shrink-har/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239441120,"owners_count":19639118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archive","devtools","har","http","https","reduce","shrink"],"created_at":"2024-10-23T19:42:42.093Z","updated_at":"2026-02-16T01:43:48.210Z","avatar_url":"https://github.com/markSmurphy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shrink-har\n\n![Version](https://img.shields.io/npm/v/shrink-har?style=plastic)\n![node-current](https://img.shields.io/node/v/shrink-har?style=plastic)\n[![Codacy Badge](https://app.codacy.com/project/badge/Grade/99616f4abbc54e6fb78e888471814080)](https://www.codacy.com/gh/markSmurphy/shrink-har/dashboard?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=markSmurphy/shrink-har\u0026amp;utm_campaign=Badge_Grade)\n![GitHub issues](https://img.shields.io/github/issues/markSmurphy/shrink-har?style=plastic)\n[![Known Vulnerabilities](https://snyk.io/test/github/markSmurphy/shrink-har/badge.svg?targetFile=package.json)](https://snyk.io/test/github/markSmurphy/shrink-har?targetFile=package.json)\n![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/shrink-har?style=plastic)\n![Downloads Total](https://badgen.net/npm/dt/shrink-har)\n![Downloads/Month](https://img.shields.io/npm/dm/shrink-har.svg?style=plastic)\n![Last Commit](https://badgen.net/github/last-commit/markSmurphy/shrink-har)\n![Licence](https://img.shields.io/npm/l/shrink-har.svg?style=plastic)\n\n![shrink-har screenshot](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/analysis.gif)\n\n**Shrink-HAR** is a command line utility that reduces the size of saved [HTTP Archive files](https://en.wikipedia.org/wiki/HAR_(file_format)) by removing the response body.\n\n*Caution* This tool is destructive. If you're using `HAR` files to debug API responses, or any other payload, then this tool isn't for you. It is *only* useful if your debugging needs are limited to HTTP request/response headers thereby rendering the response bodies superfluous.\n\n## Overview\n\nHTTP Archive files can be large when they contain multiple response bodies. I wrote this tool when I needed to retain dozens of `HAR` files but was only interested in HTTP headers. The response bodies (images, CSS, Javascript, API JSON, etc) were superfluous to my needs but were the majority of the file sizes.\n\nShrink-HAR will:\n\n* Analyse `HAR` files and report on potential savings.\n* Optionally backup existing `HAR` files to a `ZIP` file before shrinking them.\n* Shrink `HAR` files by stripping them, permanently, of all the response bodies.\n\n## Installation\n\nInstall globally via `npm` using:\n\n```shell\nnpm install -g shrink-har\n```\n\n## Usage\n\nBy default, running `shrink-har` without any options will result in an analysis of `*.har` files in the current directory:\n\n```shell\nshrink-har\n```\n\nThis behaviour can be modified via the following options.\n\n### --file \u003cfilespec\u003e\n\n`--file \u003cfilespec\u003e`\n\nSpecifies a filename or, using wildcards, a file specification.\n\nDefault: `*.har`\n\ne.g.\n\n```shell\nshrink-har --file www.amazon.co.uk.har\n```\n\n-or-\n\n```shell\nshrink-har --file *amazon*.har\n```\n\n### --directory\n\n`--directory \u003cpath\u003e`\n\nSpecifies the target directory.\n\nDefault: `.` (current working directory)\n\ne.g.\n\n```shell\nshrink-har --directory ~/Downloads/\n```\n\n### --commit\n\n`--commit`\n\nCommit changes to files. If absent only an analysis is performed. A confirmation prompt is also shown, which can be modified with `--yes`.\n\nDefault: `false`\n\ne.g.\n\n```shell\nshrink-har --commit\n```\n\n### --yes\n\n`--yes`\n\nAutomatically answer \"*yes*\" to confirmation prompts. Use with `--commit`.\n\nDefault: `false`\n\ne.g.\n\n```shell\nshrink-har --commit --yes\n```\n\n### --backup\n\n``--backup``\n\nBackup all target `.har` files into a single `.zip` file before committing changes.\n\nDefault: `false`\n\ne.g.\n\n```shell\nshrink-har --commit --backup\n```\n\n### --verbose\n\n`--verbose`\n\nEnables verbose output.\n\nDefault: `false`\n\ne.g.\n\n```shell\nshrink-har --verbose\n```\n\n### --debug\n\n`--debug`\n\nEnables debugging output.\n\nDefault: `false`\n\ne.g.\n\n```shell\nshrink-har --debug\n```\n\n### --no-color\n\n`--no-color`\n\nSwitches off colour output.\n\n### --version\n\n`--version`\n\nDisplay version number.\n\n### --help\n\n`--help`\n\nDisplays help screen.\n\n## Examples\n\n### Analyse current directory\n\nAnalyse `*.har` in the current directory:\n\n```shell\nshrink-har\n```\n\n![shrink-har](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/analysis.gif)\n\n---\n\n### Verbose output of current directory's analysis\n\nAnalyse `*.har` in the current directory displaying verbose output\n\n```shell\nshrink-har --verbose\n```\n\n![shrink-har --verbose](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/shrink-har--verbose.gif)\n\n---\n\n### Shrink all HAR files in current directory (interactive)\n\nShrink `*.har` in the current directory, with a confirmation prompt\n\n```shell\nshrink-har --commit\n```\n\n![shrink-har --commit](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/shrink-har--commit.gif)\n\n---\n\n### Backup and Shrink all HAR files in current directory (silent)\n\nShrink `*.har` in the current directory, with no prompts, after making a backup\n\n```shell\nshrink-har --commit --yes --backup\n```\n\n![shrink-har --commit --yes --backup](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/shrink-har--commit--yes--backup.gif)\n\n---\n\n### Shrink specific file in specific directory (interactive)\n\nShrink the file `www.example.com.har` in `./Downloads` after a confirmation prompt\n\n```shell\nshrink-har --file www.example.com.har --directory ./Downloads --commit\n```\n\n![shrink-har --file www.example.com.har --directory ./Downloads --commit](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/shrink-har--file--directory--commit.gif)\n\n---\n\n### Shrink all HAR files in specific directory without backing up (silent)\n\nShrink `*.har` in `./Downloads/HARFiles/` without backing up and with no prompt\n\n\u003e Warning, this command permanently removes data silently\n\n```shell\nshrink-har --directory ./Downloads/HARFiles/ --commit --yes\n```\n\n![shrink-har --directory ./Downloads/HARFiles/ --commit --yes](https://raw.githubusercontent.com/markSmurphy/shrink-har/master/screenshots/shrink-har--directory--commit--yes.gif)\n\n## Change Log\n\nThe **Change Log** can be found [in CHANGELOG.md here](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksmurphy%2Fshrink-har","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarksmurphy%2Fshrink-har","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarksmurphy%2Fshrink-har/lists"}