npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-yslow

v0.0.4

Published

Set a threshold for page weight, page load, and analyse your webpage performance.

Downloads

30

Readme

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');

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

###Options

  • thresholds (object) - An object specifying the global thresholds to test against. These can be overridden by higher specificity against inside the files section below.
    • weight (number) - The maximum page weight allowed (kb).
    • speed (number) - The maximum load time of the page allowed (ms).
    • score (number) - The minimum [YSlow performance score] (http://yslow.org/ruleset-matrix/) (out of 100) required.
    • requests - The maximum number of requests the page is allowed to send on load.
  • yslowOptions (object) - An object specifying any additional parameters for Yslow to use when running the test. This can be overridden below, like thresholds.
    • userAgent (string) - The User-Agent to present to the server
    • cdns (array of strings) - A list of additional hostnames for Yslow to accept as a Content Delivery Network
    • viewport (string) - the size of the viewport in the form WxH, where W is the width and H is the height
    • headers (object) - an object where keys are the header names and values are the values of additional headers to add to the request
  • files (object) - An array of objects, specifying a seperate page to test. Generally this is wrapped inside a named sub-task, such as the 'pages' task in the example below.
    • src (string) - The absolute url to test.
    • thresholds (object) - Any overrides to the global thresholds for this page.
    • yslowOptions (object) - Any overrides to the global Yslow Options for this page.

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
        }
      }
    ]
  }
}