JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q24640F
  • License MIT

Run Lighthouse performance tests easily from your app

Package Exports

  • perfomatic

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (perfomatic) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Perfomatic

Run Lighthouse performance tests easily from your app

screenshot

Install

From your app's root:

npm install perfomatic --save-dev

Add a simple perfomatic config to your package.json

"perfomatic": {
  "urls": [
    "http://localhost:5000"
  ],
  "overall": 95,
  "budget": {
    "speed-index-metric": 90,
    "time-to-first-byte": true
  }
}

Make an npm script for it

"scripts": {
  "perf": "perfomatic"
}

START UP YOUR SERVER at the urls you want to test against, then run perfomatic:

npm run perf

OR

Sample vscode debugger setup (put this in your app to run with F5 debugger)

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Perfomatic Tests",
      "stopOnEntry": false,
      "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
      "args": ["--no-timeouts", "--colors", "${workspaceFolder}/node_modules/perfomatic/test.js"],
      "internalConsoleOptions": "openOnSessionStart"
    }
  ]
}

All available package.json config options

"perfomatic": {
  "urls": [
    "http://localhost:5000"
  ],
  "verbose": true, // show metric output, and HELP feedback about failed metrics
  "showAvailableMetrics": true, // print current available metrics and scoring types, binary or numeric
  "overall": 90,
  "budget": {
    "speed-index-metric": 90, // numeric (0-100, higher is better)
    "time-to-first-byte": true, // binary (false)
    ... // all the other metrics
    }
  }
}