Socket
Socket
Sign inDemoInstall

gpagespeed

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpagespeed

Analyze a webpage with Google PageSpeed


Version published
Weekly downloads
251
decreased by-29.49%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status js-standard-style

gpagespeed

Node.js module for analyzing a webpage with Google PageSpeed Insights.

You must acquire an API key from Google Developers Console.

Usage

Pass an object with properties.

url and key are required, all other are optional.

You can see a list of all alternatives on the page for Google PageSpeed standard query parameters.

const pagespeed = require('gpagespeed')
const options = {
  url: 'http://url-to-check',
  key: 'insert-your-key'
}

pagespeed(options)
  .then(data => {
    console.log(data)
  })
  .catch(error => {
    console.error(error)
  })

Alternative api

In addition you can choose to use https instead of googleapis and another version of the PageSpeed api (defaults to v4).

const pagespeed = require('gpagespeed')
const options = {
  url: 'http://url-to-check',
  key: 'insert-your-key',
  useweb: true,
  apiversion: 'v3beta1'
}

pagespeed(options)
  .then((data) => {
    console.log(data)
  })
  .catch((error) => {
    console.error(error)
  })

Returns

return-example.md

  • gpagespeed-cli CLI for this module

License

MIT

Keywords

FAQs

Package last updated on 11 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc