Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metrics-pli/core
Get metrics from a real browser using Puppeteer and Lighthouse
https://github.com/metrics-pli/core
chromeless headless headless-chrome lighthouse performance performance-analysis performance-metrics puppeteer
Last synced: about 2 months ago
JSON representation
Get metrics from a real browser using Puppeteer and Lighthouse
- Host: GitHub
- URL: https://github.com/metrics-pli/core
- Owner: metrics-pli
- License: mit
- Created: 2018-04-24T08:33:01.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-19T08:58:05.000Z (over 6 years ago)
- Last Synced: 2024-10-11T16:38:36.788Z (3 months ago)
- Topics: chromeless, headless, headless-chrome, lighthouse, performance, performance-analysis, performance-metrics, puppeteer
- Language: TypeScript
- Homepage:
- Size: 1.5 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Metrics PLI
## Usage
Install via npm
npm i @metrics-pli/core @metrics-pli/types
You need to write your tests like to match the interface `TestInterface`.
An example:
```typescript
import MetricsPli from "@metrics-pli/core";
import { ConfigInterface, TestInterface } from "@metrics-pli/types";import * as fs from "fs";
import * as path from "path";const tests: TestInterface[] = [{
name: "Homepage",
url: "https://google.com/",
}];const config: ConfigInterface = {};
(async () => {
const saveToFilepath = path.resolve(__dirname, "test.json");
const metricsPli = new MetricsPli(tests, config);metricsPli.on("error", console.error);
metricsPli.on("data", ({ result, test }) => {
// result is of type ResultsetInterface
// test is of type TestInterface
fs.writeFileSync(saveToFilepath, JSON.stringify(result), "utf-8");
});metricsPli.run();
})();
```## License
MIT