{"id":18034334,"url":"https://github.com/johansatge/psi-report","last_synced_at":"2025-03-27T06:31:30.116Z","repository":{"id":57140885,"uuid":"46172846","full_name":"johansatge/psi-report","owner":"johansatge","description":"Crawls a website, gets PageSpeed Insights data for each page, and exports an HTML report.","archived":false,"fork":false,"pushed_at":"2018-01-23T12:16:59.000Z","size":617,"stargazers_count":11,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T00:43:32.200Z","etag":null,"topics":["cli","crawler","html-report","pagespeed-insights"],"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/johansatge.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-14T11:55:19.000Z","updated_at":"2023-11-16T09:27:31.000Z","dependencies_parsed_at":"2022-09-01T23:51:44.582Z","dependency_job_id":null,"html_url":"https://github.com/johansatge/psi-report","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fpsi-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fpsi-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fpsi-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johansatge%2Fpsi-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johansatge","download_url":"https://codeload.github.com/johansatge/psi-report/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245797563,"owners_count":20673885,"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":["cli","crawler","html-report","pagespeed-insights"],"created_at":"2024-10-30T11:10:47.411Z","updated_at":"2025-03-27T06:31:29.639Z","avatar_url":"https://github.com/johansatge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Version](https://img.shields.io/npm/v/psi-report.svg)\n![Downloads](https://img.shields.io/npm/dm/psi-report.svg)\n![Dependencies](https://img.shields.io/david/johansatge/psi-report.svg)\n![devDependencies](https://img.shields.io/david/dev/johansatge/psi-report.svg)\n\n# psi-report\n\nCrawls a website or get URLs from a sitemap.xml or a file, gets [PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) data for each page, and exports an HTML report.\n\n![](screenshot.png)\n\n---\n\n* [Installation](#installation)\n* [CLI usage](#cli-usage)\n* [Programmatic usage](#programmatic-usage)\n* [Crawler behavior](#crawler-behavior)\n* [Changelog](#changelog)\n* [License](#license)\n* [Credits](#credits)\n\n## Installation\n\nInstall with [npm](https://www.npmjs.com/):\n\n```bash\n$ npm install psi-report --global\n# --global isn't required if you plan to use the node module\n```\n\n## CLI usage\n\n```bash\n$ psi-report [options] \u003curl\u003e \u003cdest_path\u003e\n```\n\nOptions:\n\n```bash\n    -V, --version               output the version number\n    --urls-from-sitemap [name]  Get the list of URLs from sitemap.xml (don't crawl)\n    --urls-from-file [name]     Get the list of URLs from a file, one url per line (don't crawl)\n    -h, --help                  output usage information\n```\n\nExample:\n\n```bash\n$ psi-report daringfireball.net/projects/markdown /Users/johan/Desktop/report.html\n```\n\n## Programmatic usage\n\n```javascript\n// Basic usage\n\nvar PSIReport = require('psi-report');\nvar psi_report = new PSIReport({baseurl: 'http://domain.org'}, onComplete);\npsi_report.start();\n\nfunction onComplete(baseurl, data, html)\n{\n    console.log('Report for: ' + baseurl);\n    console.log(data); // An array of pages with their PSI results\n    console.log(html); // The HTML report (as a string)\n}\n\n// The \"fetch_url\" and \"fetch_psi\" events allow to monitor the crawling process\n\npsi_report.on('fetch_url', onFetchURL);\nfunction onFetchURL(error, url)\n{\n    console.log((error ? 'Error with URL: ' : 'Fetched URL: ') + url);\n}\n\npsi_report.on('fetch_psi', onFetchPSI);\nfunction onFetchPSI(error, url, strategy)\n{\n    console.log((error ? 'Error with PSI for ' : 'PSI data (' + strategy + ') fetched for ') + url);\n}\n```\n\n## Crawler behavior\n\nThe base URL is used as a root when crawling the pages.\n\nFor instance, using the URL `https://daringfireball.net/` will crawl the entire website.\n\nHowever, `https://daringfireball.net/projects/markdown/` will crawl only:\n\n* `https://daringfireball.net/projects/markdown/`\n* `https://daringfireball.net/projects/markdown/basics`\n* `https://daringfireball.net/projects/markdown/syntax`\n* `https://daringfireball.net/projects/markdown/license`\n* And so on\n\n*This may be useful to crawl only one part of a website: everything starting with `/en`, for instance.*\n\n## URLs from a sitemap.xml or a file\n\nInstead of crawling the website, you can set the URL list with a sitemap.xml or a file.\n\n* `--urls-from-sitemap https://example.com/sitemap.xml`\n* `--urls-from-file /path/to/urls.txt`\n\nOnly the URLs inside this file will be processed.\n\n## Changelog\n\nThis project uses [semver](http://semver.org/).\n\n| Version | Date | Notes |\n| --- | --- | --- |\n| `2.2.1` | 2018-01-19 | Fix missing source files on NPM (@blaryjp)|\n| `2.2.0` | 2017-11-27 | Prepend baseurl if not present, for each urls in file (@blaryjp)|\n| `2.1.0` | 2017-11-19 | Add `--urls-from-sitemap` and `--urls-from-file` (@blaryjp)|\n| `2.0.0` | 2016-04-02 | Deep module rewrite (New module API, updated CLI usage) |\n| `1.0.1` | 2016-01-15 | Fix call on obsolete package |\n| `1.0.0` | 2015-12-01 | Initial version |\n\n## License\n\nThis project is released under the [MIT License](license.md).\n\n## Credits\n\n* [async](https://github.com/caolan/async)\n* [colors](https://github.com/Marak/colors.js)\n* [request](https://github.com/request/request)\n* [crawler](https://github.com/sylvinus/node-crawler)\n* [commander](https://github.com/tj/commander.js)\n* [sitemapper](https://github.com/hawaiianchimp/sitemapper)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohansatge%2Fpsi-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohansatge%2Fpsi-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohansatge%2Fpsi-report/lists"}