Giter Site home page Giter Site logo

howfast's Introduction

howfast

CircleCI

A simple CLI for generating more accurate data from Lighthouse reports.

Installation

The easiest way to install is to globally install via npm.

npm install -g @tallnerds/howfast

Usage

To see up to date usage, you can always run

howfast -h

Here is a typical example of hitting a site 5 times

howfast -s https://google.com -t 5

Here is an example of hitting a site that requires an Authorization header

howfast -s https://google.com -a 'Basic aG93ZmFzdDpyb2Nrcw=='

By default, this will also generate a json file with all of the metrics you would need to do more detailed analysis. Upon completing the runs, it will open this file automatically for you. By default, this file is stored in /tmp, but can be modified with the -f flag.

howfast -s https://google.com -t 5 -f ~/Downloads

Lastly, if you are creating a PR and want to quickly generate some markup, you can change the report type to html using the --html flag. This will give you a generated html file (rather than json) with the results displayed in different ways (json, markdown, etc).

howfast -s https://google.com -t 5 -f ~/Downloads --html

Reports

There are 2 types of reports that can be generated from this tool: json and html.

Json

The default report output is json. Here is the generate structure of the json file:

{
  "metricName": {
    "label": "<[string] label>",
    "scorePath": "<[string] path to score in original lighthouse data>",
    "metricPath": "<[string] [optional] path to metric in original lighthouse data>",
    "average": {
      "score": "[number]",
      "numericValue": "[number]"
    },
    "median": {
      "score": "[number]",
      "numericValue": "[number]"
    },
    "actual": {
      "scores": "[array<number>]",
      "numericValues": "[array<number>]"
    }
  }
}

Here is a nice visual representation

Contributing

Re-render Usage Gif

We use a really neat-o tool for generating the console gif above. To re-render, simply re-record

terminalizer record terminal-demo

tweak the settings at ./terminal-demo.yml

and record

terminalizer render terminal-demo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.