{"id":13583718,"url":"https://github.com/sitespeedio/pagexray","last_synced_at":"2025-04-04T22:06:14.779Z","repository":{"id":1770683,"uuid":"41604840","full_name":"sitespeedio/pagexray","owner":"sitespeedio","description":"Xray your HAR file and know all about the page","archived":false,"fork":false,"pushed_at":"2023-11-06T04:48:00.000Z","size":2299,"stargazers_count":83,"open_issues_count":11,"forks_count":15,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-04-14T17:26:49.537Z","etag":null,"topics":["har","web","xray"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sitespeedio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-08-29T19:30:39.000Z","updated_at":"2024-01-10T09:18:13.000Z","dependencies_parsed_at":"2023-12-14T23:48:36.186Z","dependency_job_id":null,"html_url":"https://github.com/sitespeedio/pagexray","commit_stats":{"total_commits":390,"total_committers":8,"mean_commits":48.75,"dds":0.2384615384615385,"last_synced_commit":"85e31b4c9d03081d33196d99d1cb50dc0eb254c6"},"previous_names":["sitespeedio/snufkin"],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fpagexray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fpagexray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fpagexray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitespeedio%2Fpagexray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitespeedio","download_url":"https://codeload.github.com/sitespeedio/pagexray/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247256112,"owners_count":20909240,"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":["har","web","xray"],"created_at":"2024-08-01T15:03:43.441Z","updated_at":"2025-04-04T22:06:14.762Z","avatar_url":"https://github.com/sitespeedio.png","language":"JavaScript","readme":"# PageXray\n\n![Unit tests](https://github.com/sitespeedio/pagexray/workflows/Unit%20tests/badge.svg?branch=main)\n\n![Page Xray](img/pagexray.png)\n\nWe love the HAR file but it's hard to actually see what the page includes only looking at the file. The PageXray converts a HAR file to a JSON format that is easier to read. We use the format internally in the coach and sitespeed.io. And with PageXray you can use it standalone in your browser.\n\n## What do we collect?\n\n * The size and the number of requests per content type\n * The size and requests per domain\n * The number of requests per response code\n * The base domain and the httpVersion used for the base asset (the main HTML document)\n * All assets (responses) with the following data: type, url, size, expires (a normalized expires converting max-age/expires to just expires in seconds), status (response code), timeSinceLastModified (using the last modified field in the response header and normalizing to seconds), httpVersion and all request and response headers.\n * If you use a HAR from WebPageTest we also get SpeedIndex and other VisualMetrics. \n * If your HAR is from sitespeed.io you will also get some extra metrics like SpeedIndex.\n\n## Install\n```bash\nnpm install pagexray -g\n```\n\n## Run\n```bash\npagexray /path/to/my.har\n```\n\nOr if you want to prettify the HAR\n```bash\npagexray --pretty /path/to/my.har\n```\nAnd if you want to get info per request/response:\n```bash\npagexray --includeAssets /path/to/my.har\n```\n\nIf you want to use it in node, use it like this:\n```node\nconst fs = require(\"fs\");\nconst pagexray = require(\"pagexray\");\nconst har = JSON.parse(fs.readFileSync(\"/path/to/my.har\"));\n\nconst pages = pagexray.convert(har);\n// Or ofyou want to include the each asset information\n// const pages = pagexray.convert(har, {includeAssets: true});\n\nconsole.log(pages)\n```\n## Using in your browser\nInclude the latest pagexray.min.js (that you find in the relases) on your page. PageXray is exposed as *window.PageXray*\n\n```javascript\nconst pageXray = window.PageXray.convert(har);\n```\n\n## Output\nAll sizes are in bytes. Expires and timeSinceLastModified are in seconds.\n\n```json\n[\n  {\n    \"url\": \"https://www.sitespeed.io/\",\n    \"meta\": {\n      \"browser\": {\n        \"name\": \"Chrome\",\n        \"version\": \"60.0.3112.78\"\n      },\n      \"startedDateTime\": \"2017-08-24T18:26:29.077Z\",\n      \"connectivity\": \"native\",\n      \"title\": \"Sitespeed.io - Welcome to the wonderful world of Web Performance run 1\"\n    },\n    \"finalUrl\": \"https://www.sitespeed.io/\",\n    \"baseDomain\": \"www.sitespeed.io\",\n    \"documentRedirects\": 0,\n    \"redirectChain\": [],\n    \"transferSize\": 98791,\n    \"contentSize\": 120776,\n    \"headerSize\": 0,\n    \"requests\": 10,\n    \"missingCompression\": 0,\n    \"httpType\": \"h2\",\n    \"httpVersion\": \"HTTP/2.0\",\n    \"contentTypes\": {\n      \"html\": {\n        \"transferSize\": 8479,\n        \"contentSize\": 28279,\n        \"headerSize\": 0,\n        \"requests\": 1\n      },\n      \"css\": {\n        \"transferSize\": 0,\n        \"contentSize\": 0,\n        \"headerSize\": 0,\n        \"requests\": 0\n      },\n      \"javascript\": {\n        \"transferSize\": 0,\n        \"contentSize\": 0,\n        \"headerSize\": 0,\n        \"requests\": 0\n      },\n      \"image\": {\n        \"transferSize\": 87309,\n        \"contentSize\": 85979,\n        \"headerSize\": 0,\n        \"requests\": 8\n      },\n      \"font\": {\n        \"transferSize\": 0,\n        \"contentSize\": 0,\n        \"headerSize\": 0,\n        \"requests\": 0\n      },\n      \"favicon\": {\n        \"transferSize\": 3003,\n        \"contentSize\": 6518,\n        \"headerSize\": 0,\n        \"requests\": 1\n      }\n    },\n    \"assets\": [],\n    \"responseCodes\": {\n      \"200\": 10\n    },\n    \"firstParty\": {},\n    \"thirdParty\": {},\n    \"domains\": {\n      \"www.sitespeed.io\": {\n        \"transferSize\": 98791,\n        \"contentSize\": 120776,\n        \"headerSize\": -10,\n        \"requests\": 10,\n        \"timings\": {\n          \"blocked\": 169,\n          \"dns\": 0,\n          \"connect\": 0,\n          \"send\": 6,\n          \"wait\": 3624,\n          \"receive\": 104\n        }\n      }\n    },\n    \"expireStats\": {\n      \"min\": 600,\n      \"median\": 31536000,\n      \"max\": 31536000,\n      \"total\": 283824600,\n      \"values\": 10\n    },\n    \"lastModifiedStats\": {\n      \"min\": 733347,\n      \"median\": 733444,\n      \"max\": 733480,\n      \"total\": 7334359,\n      \"values\": 10\n    },\n    \"cookieStats\": {\n      \"min\": 0,\n      \"median\": 0,\n      \"max\": 0,\n      \"total\": 0,\n      \"values\": 10\n    },\n    \"totalDomains\": 1,\n    \"visualMetrics\": {\n      \"FirstVisualChange\": 617,\n      \"SpeedIndex\": 625,\n      \"VisualComplete85\": 617,\n      \"LastVisualChange\": 1033,\n      \"VisualProgress\": {\n        \"0\": 0,\n        \"617\": 98,\n        \"633\": 98,\n        \"667\": 98,\n        \"850\": 98,\n        \"1033\": 100\n      }\n    }\n  }\n]\n\n```\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitespeedio%2Fpagexray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitespeedio%2Fpagexray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitespeedio%2Fpagexray/lists"}