🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

grunt-pagespeed-junit

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-pagespeed-junit

Pagespeed to junit task runner for grunt.

0.3.1
latest
Source
npm
Version published
Maintainers
1
Created
Source

grunt-pagespeed-junit

Pagespeed to junit task runner for grunt. Perfect for outputting results in Jenkins. See Google's doc for more details on the API.

Getting Started

This plugin requires Grunt ~0.4.4

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-pagespeed-junit --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-pagespeed-junit');

The "pagespeed_junit" task

Overview

In your project's Gruntfile, add a section named pagespeed_junit to the data object passed into grunt.initConfig().

grunt.initConfig({
  pagespeed_junit: {
    options: {
      // Task-specific options go here.
    }
  }
});

Options

urls

Type: Array

A list of URL's for which the PageSpeed Insights API should generate results.

reports

Type: Array

The output destination for each URL.

key

Type: String

Your API key identifies your project and provides you with API access, quota, and reports.

threshold

Type: int Default value: 60

The score threshold in which to fail the task.

ruleThreshold

Type: Number

The rule threshold in which to fail the individual rules.

locale

Type: String

The locale that results should be generated in.

rule

Type: Array

The PageSpeed rules to run.

strategy

Type: String

The strategy to use when analyzing the page.

Usage Examples

grunt.initConfig({
  pagespeed_junit: {
    options: {
      urls: ['http://www.example.com'],
      key: '<API_KEY>',
      reports: ['results.xml'],
      threshold: 10,
      ruleThreshold: 2
    }
  }
});

###TODO

  • move to gpagespeed
  • ruleThreshold per rule

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

Keywords

gruntplugin

FAQs

Package last updated on 09 Aug 2015

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