open-index/open-npm huggingface dataset:
npm package: @metrics-pli/core
Description: Get metrics from a real browser using Puppeteer and Lighthouse
Author: Hans Christian Reinl
Latest version: 0.11.0

# 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
npm package: @metrics-pli/exporter-bigquery
Description: Google Big Query exporter for metrics-pli metrics.
Author: Christian Froehlingsdorf
Latest version: 0.16.0

# bigquery-export

Exports collected metrics to Google Big Query
Can be hooked up very easily to a metricsPli instance.

You can debug logs via `DEBUG=mpli:bqexport`.
The bigquery config fields accepts all parameters that you can pass to
`@google-cloud/bigquery`.

```javascript
import MetricsPli, { ConfigInterface, TestInterface } from "@metrics-pli/core";
import Exporter from "@metrics-pli/exporter-bigquery";

const keyFilename = "/Users/jondoe/Documents/jons-plat-123.json";

const exporterConfig = {
    bigquery: {
        projectId: "123123123",
        keyFilename,
    },
    dataset: "my_metrics_dataset",
    table: "my_metrics_table",
    batchSize: 75,
    batchTimeout: 60 * 1000,
};

const tests: TestInterface[] = [{
  name: "Homepage",
  url: "https://google.com/",
}];

const config: ConfigInterface = {};

(async () => {
  const metricsPli = new MetricsPli(tests, config);
  const bqExporter = new Exporter(exporterConfig);

  await bqExporter.init();
  bqExporter.registerWith(metricsPli);

  // will also emit exporter error events
  metricsPli.on("error", console.error);
  metricsPli.on("info", console.info);
 
  await metricsPli.run();
  await bqExporter.close();
})();
```
npm package: @metrics-pli/types
Description: Types for Metrics PLI
Author: Hans Christian Reinl
Latest version: 1.2.1

# Metrics PLI Types

Typescript interfaces and types for Metrics PLI

## Usage

Just import the interfaces you need:

```typescript
  import { TestInterface } from "@metrics-pli/types";

  const tests: TestInterface = [];

  // ...
```

## License

MIT