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-load-perf

v0.1.1

Published

Grunt task for generating visual report to measure web applications loading and rendering performance.

Downloads

9

Readme

grunt-load-perf

Grunt task for generating visual report to measure web applications loading and rendering performance.

Getting Started

This plugin is intendent to be used as loading and rendering performance measuring tool for web applications development. A list of common internet connection types provides network speed and latency simulation. They are: Fiber, Cable, DSL, 4G, 3G, 2G.

Each of these can be specified to simulate assets delivering with or without CDN. Values used here are somewhat an averages for different location around the world. This should be enough to get relevant feedback on loading performance. You can specify custom values for downstream, upstream and latency.

Once started, the task will load target page and make a set of screenshots while loading, which can be converted into GIF animation. Visual report clearly shows how your application looks like while loading on different connection types. Setting up viewport size can be used for testing responsive design.

npm install grunt-load-perf --save-dev

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

grunt.loadNpmTasks('grunt-load-perf');

The "load_perf" task

Overview

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

grunt.initConfig({
  load_perf: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

Options

options.url

Type: String Default value: 'localhost'

Remote test target path.

options.remotePort

Type: Number Default value: 80

Remote test target port.

options.localPort

Type: Number Default value: 9001

Port number at localhost.

options.networkProfile

Type: String Default value: undefined

Simulate network performance with one of the available profiles.

options.cdn

Type: Boolean Default value: false

Simulate CDN.

options.upstream

Type: Number Default value: 100 Kbit/s

Custom upstream throttling.

options.downstream

Type: Number Default value: 100 Kbit/s

Custom downstream throttling.

options.latency

Type: Number Default value: 0

Network latency in ms.

options.output

Type: String Default value: load-perf/

Screenshots directory.

options.cwd

Type: String Default value: undefined

Project root directory.

options.fps

Type: Number Default value: 2

Number of taken screenshots per second.

options.limit

Type: Number Default value: 30

Max number of taken screenshots.

options.animation

Type: String Default value: undefined

Create GIF animation file from taken screenshots. Make sure you have imagemagick installed.

options.viewportWidth

Type: Number Default value: 800

Browser viewport width, screenshot width.

options.viewportHeight

Type: Number Default value: 600

Browser viewport height, screenshot height.

Usage Examples

Basic usage

grunt.initConfig({
  load_perf: {
    localPort: 3000,
    url: 'localhost',
    remotePort: 8080,
    networkProfile: '3G',
    cdn: true,
    output: 'perf-report/',
    animation: 'my-test.gif',
    fps: 1,
    viewportWidth: 1280,
    viewportHeight: 768,
    limit: 100
  }
})

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

  • 2014-04-05   v0.1.1   Fix animation output
  • 2014-04-05   v0.1.0   Initial release

License

Copyright (c) 2014 Roman Liutikov. Licensed under the MIT license.