{"id":15508830,"url":"https://github.com/zachleat/performance-leaderboard","last_synced_at":"2025-04-09T14:06:07.668Z","repository":{"id":44983157,"uuid":"248893647","full_name":"zachleat/performance-leaderboard","owner":"zachleat","description":"A plugin to run Lighthouse against a set of urls to see which site is the fastest.","archived":false,"fork":false,"pushed_at":"2025-03-26T17:11:04.000Z","size":100,"stargazers_count":98,"open_issues_count":6,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-02T12:41:18.137Z","etag":null,"topics":["speedlify"],"latest_commit_sha":null,"homepage":"","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/zachleat.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2020-03-21T02:39:03.000Z","updated_at":"2025-03-26T17:11:08.000Z","dependencies_parsed_at":"2024-03-13T22:31:24.985Z","dependency_job_id":"dde394f0-a7bf-4f5e-8b96-998462137d17","html_url":"https://github.com/zachleat/performance-leaderboard","commit_stats":{"total_commits":126,"total_committers":4,"mean_commits":31.5,"dds":"0.10317460317460314","last_synced_commit":"5145e02f4e9d6ee990b5ae7e1476fe4742b4df4b"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fperformance-leaderboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fperformance-leaderboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fperformance-leaderboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachleat%2Fperformance-leaderboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachleat","download_url":"https://codeload.github.com/zachleat/performance-leaderboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054228,"owners_count":21039952,"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":["speedlify"],"created_at":"2024-10-02T09:40:26.978Z","updated_at":"2025-04-09T14:06:07.637Z","avatar_url":"https://github.com/zachleat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# performance-leaderboard\n\nA plugin to run Lighthouse against a set of urls to see which site is the fastest.\n\n* See also: [`performance-leaderboard-pagespeed-insights`](https://github.com/zachleat/performance-leaderboard-pagespeed-insights/) (runs Lighthouse through PageSpeed Insights)\n\n## Installation\n\n```sh\nnpm install performance-leaderboard\n```\n\n## Features\n\n* Median Run Selection: `performance-leaderboard` will run Lighthouse on the same site multiple times and select the Median run. It factors in First Contentful Paint, Largest Contentful Paint, and Time to Interactive when [selecting the median run](https://github.com/zachleat/performance-leaderboard/blob/master/lib/lh-median-run.js#L55).\n\n## Usage\n\n1. Create a test file, say `sample.js`:\n\n```js\nconst PerfLeaderboard = require(\"performance-leaderboard\");\n\n(async function() {\n\n\tlet urls = [\n\t\t\"https://www.gatsbyjs.org/\",\n\t\t\"https://nextjs.org/\",\n\t\t\"https://www.11ty.dev/\",\n\t\t\"https://vuejs.org/\",\n\t\t\"https://reactjs.org/\",\n\t\t\"https://jekyllrb.com/\",\n\t\t\"https://nuxtjs.org/\",\n\t\t\"https://gohugo.io/\",\n\t];\n\n\t// Create the options object (not required)\n\tconst options = {\n\t\taxePuppeteerTimeout: 30000, // 30 seconds\n\t\twriteLogs: true, // Store audit data\n\t\tlogDirectory: '.log', // Default audit data files stored at `.log`\n\t\treadFromLogDirectory: false, // Skip tests with existing logs\n\t\t// onlyCategories: [\"performance\", \"accessibility\"],\n\t\tchromeFlags: ['--headless'],\n\t\tfreshChrome: \"site\", // or \"run\"\n\t\tlaunchOptions: {}, // Puppeteer launch options\n\t}\n\n\t// Run each site 3 times with default options\n\tconsole.log( await PerfLeaderboard(urls) );\n\n\t// Or run each site 5 times with default options\n\tconsole.log( await PerfLeaderboard(urls, 5) );\n\n\t// Or run each site 5 times with custom options\n\tconsole.log( await PerfLeaderboard(urls, 5, options) );\n})();\n```\n\n2. Run `node sample.js`.\n\n\u003cdetails\u003e\n\u003csummary\u003eSample Output\u003c/summary\u003e\n\n```js\n[\n\t{\n\t\turl: 'https://www.11ty.dev/',\n\t\trequestedUrl: 'https://www.11ty.dev/',\n\t\ttimestamp: 1623525988492,\n\t\tranks: { hundos: 1, performance: 1, accessibility: 1, cumulative: 1 },\n\t\tlighthouse: {\n\t\t\tversion: '8.0.0',\n\t\t\tperformance: 1,\n\t\t\taccessibility: 1,\n\t\t\tbestPractices: 1,\n\t\t\tseo: 1,\n\t\t\ttotal: 400\n\t\t},\n\t\tfirstContentfulPaint: 1152.3029999999999,\n\t\tfirstMeaningfulPaint: 1152.3029999999999,\n\t\tspeedIndex: 1152.3029999999999,\n\t\tlargestContentfulPaint: 1152.3029999999999,\n\t\ttotalBlockingTime: 36,\n\t\tcumulativeLayoutShift: 0.02153049045138889,\n\t\ttimeToInteractive: 1238.3029999999999,\n\t\tmaxPotentialFirstInputDelay: 97,\n\t\ttimeToFirstByte: 54.63900000000001,\n\t\tweight: {\n\t\t\tsummary: '14 requests • 178 KiB',\n\t\t\ttotal: 182145,\n\t\t\timage: 124327,\n\t\t\timageCount: 10,\n\t\t\tscript: 7824,\n\t\t\tscriptCount: 1,\n\t\t\tdocument: 30431,\n\t\t\tfont: 15649,\n\t\t\tfontCount: 1,\n\t\t\tstylesheet: 3914,\n\t\t\tstylesheetCount: 1,\n\t\t\tthirdParty: 15649,\n\t\t\tthirdPartyCount: 1\n\t\t},\n\t\trun: { number: 2, total: 3 },\n\t\taxe: { passes: 850, violations: 0 },\n\t}\n]\n```\n\n\u003c/details\u003e\n\n## Rankings\n\nIn the return object you’ll see a `ranks` object listing how this site compares to the other sites in the set. There are a bunch of different scoring algorithms you can choose from:\n\n* `ranks.performance`\n\t* The highest Lighthouse performance score.\n\t* Tiebreaker given to the lower SpeedIndex score.\n* `ranks.accessibility`\n\t* The highest Lighthouse accessibility score.\n\t* Tiebreaker given to lower Axe violations.\n\t* Second tiebreaker given to highest Axe passes (warning: each instance of an Axe rule passing is treated separately so this will weigh heavily in favor of larger pages)\n* `ranks.hundos`\n\t* The sum of all four Lighthouse scores.\n\t* Tiebreaker given to the lower Speed Index / Total Page Weight ratio.\n* `ranks.cumulative` (the same as `hundos` but with an Axe tiebreaker)\n\t* The sum of all four Lighthouse scores.\n\t* Tiebreaker given to the lower Axe violations.\n\t* Second tiebreaker given to the lower Speed Index / Total Page Weight ratio.\n\n## Changelog\n\n* `v11.0.0` Update [`lighthouse` to v11](https://github.com/GoogleChrome/lighthouse/releases/tag/v11.0.0), requires Node \u003e= 18.16.\n* `v10.0.0` Update [`lighthouse` to v10](https://github.com/GoogleChrome/lighthouse/releases/tag/v10.0.0), requires Node 16.\n* `v9.0.0` Update `lighthouse` to v9.0. Removes `carbonAudit`, upstream API was removed.\n* `v5.3.0` Update `lighthouse` from v8.2 to v8.5\n* `v5.2.0` Update `lighthouse` from v8.0 to v8.2\n* `v5.1.0` Adds `axePuppeteerTimeout` option. Adds `carbonAudit` option.\n* `v5.0.0` Update `lighthouse` to v8.0\n* `v4.1.0` Update `lighthouse` to v7.3\n* `v4.0.0` Major version upgrade of `lighthouse` dependency from v6.5 to v7.2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachleat%2Fperformance-leaderboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachleat%2Fperformance-leaderboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachleat%2Fperformance-leaderboard/lists"}