Home

Awesome

grunt-yslow

Grunt task for testing page performance using PhantomJS, a headless WebKit browser.

Getting Started

Install this grunt plugin next to your project's [grunt.js gruntfile] with: npm install grunt-yslow --save-dev

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-yslow');

Also make sure that phantomjs is in the $PATH. You can add ./node_modules/grunt-yslow/node_modules/grunt-lib-phantomjs/node_modules/phantomjs or do a $ npm install --global phantomjs


##Config All config must be specified in your Gruntfile.js under the task name yslow.

###Options


Example Grunt Task

yslow: {
  options: {
    thresholds: {
      weight: 180,
      speed: 1000,
      score: 80,
      requests: 15
    }
  },
  pages: {
    files: [
      {
        src: 'http://andyshora.com'
      },
      {
        src: 'http://www.google.co.uk',
        thresholds: {
          weight: 100
        }
      }
    ]
  }
}