/pagespeed

CLI tool and API Wrapper for the PageSpeed Insights API written in Deno 🦕

Primary LanguageTypeScriptMIT LicenseMIT

pagespeed

tag CI nest badge

CLI tool and API Wrapper for the PageSpeed Insights API written in Deno

Inspired by https://github.com/GoogleChromeLabs/psi

Screen Shot

Screen Shot

Module

Usage

import { runPagespeed } from "https://deno.land/x/pagespeed/mod.ts";

const data = await runPagespeed("https://developers.google.com", {
  strategy: "mobile",
});

console.log(data);

Options

Option Type Default Description
strategy string desktop The analysis strategy
key string API Key

CLI

Install

$ deno install --allow-net --name pagespeed https://deno.land/x/pagespeed/mod.ts

Usage

pagespeed https://developers.google.com --strategy mobile --times 3

Options

Usage: pagespeed [url] [options]

Options:
  -h, --help: display help message
  -s, --strategy: The analysis strategy (desktop or mobile) to use, and desktop is the default
  -k, --key: API Key(Optional)
  -t, --times: Number of times
  -i, --interval: Time interval(ms)

Testing

$ deno test --allow-net

Code formatter

$ deno fmt

License

MIT LICENSE