https://github.com/sitespeedio/coach-core
Core functionality for the Coach
https://github.com/sitespeedio/coach-core
Last synced: about 2 months ago
JSON representation
Core functionality for the Coach
- Host: GitHub
- URL: https://github.com/sitespeedio/coach-core
- Owner: sitespeedio
- License: mit
- Created: 2020-03-09T20:34:19.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-08-04T19:34:52.000Z (9 months ago)
- Last Synced: 2025-10-06T13:29:47.299Z (7 months ago)
- Language: JavaScript
- Size: 2.65 MB
- Stars: 1
- Watchers: 0
- Forks: 6
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# The Coach - core

[Documentation](https://www.sitespeed.io/documentation/coach/) | [Changelog](https://github.com/sitespeedio/coach-core/blob/main/CHANGELOG.md)

The coach helps you find performance, best practice and privacy problems on your web page. *coach-core* holds the JavaScript functionality to analyse your page, the [Coach project](https://github.com/sitespeedio/coach) is the CLI.
```js
const coach = require('coach-core');
// Get the JavaScript code that will analyse a page
const domAdviceJavaScript = await coach.getDomAdvice();
// Take the *domAdviceJavaScript* and run it in your browser and take care of the result.
const domResult = ...
const har = // we get the HAR from a browser
// If your HARhar contains multiple pages (multiple runs etc) you can use the API
// to get the page that you want
const firstPageHar = coach.pickAPage(har, 0);
const harResult = await coach.analyseHar(firstPageHar);
// Say that you got the result from the browser in domAdviceResult
// and the HAR result in harAdviceResult
const coachResult = coach.merge(domResult, harResult);
```
[travis-image]: https://img.shields.io/travis/sitespeedio/coach-core/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/sitespeedio/coach-core