per
perfbudget
npm i perfbudget
per

perfbudget

A stand-alone version of Tim Kadlec's (@tkadlec) grunt-perfbudget plugin.

by Oliver Farrell

0.0.9 (see all)License:MITTypeScript:Not Found
npm i perfbudget
Readme

perfbudget

Build Status

A stand-alone version of Tim Kadlec's (@tkadlec) grunt-perfbudget plugin.

Note: This is still a work in progress and things are likely to change with each release. As it stands this package works directly in CLI. I'll be working to make it easier to integrate with a Node project.

Installation

# cli usage
$ npm install -g perfbudget

# node module usage
$ npm install perfbudget

Usage

CLI

# using www.webpagetest.org
$ perfbudget --url http://www.bbc.co.uk --key [api_key]

# using private instance
$ perfbudget --url http://www.bbc.co.uk --instance [instance_url] --key [api_key] --location [location]

# setting budgets
$ perfbudget --url http://www.bbc.co.uk --key [api_key] --SpeedIndex 2000 --render 400

Flags

Config:

  • --url - URL you want WPT to run against | default : ""
  • --key - API key for WPT instance | default : ""
  • --instance - WPT instance to use | default : www.webpagetest.org
  • --location - WPT location to use | default : Dulles:Chrome

Budget:

  • --visualComplete | default : ""
  • --render | default : "1000"
  • --loadTime | default : ""
  • --docTime | default : ""
  • --fullyLoaded | default : ""
  • --bytesIn | default : ""
  • --bytesInDoc | default : ""
  • --requests | default : ""
  • --requestsDoc | default : ""
  • --SpeedIndex | default : "1000"

Node module

var perfbudget = require('perfbudget');

perfbudget.runTest(options, function(err, result) {
  if (err) {
    return console.log(err);
  }

  if (!result.pass) {
    console.log(
      '\n-----------------------------------------------' +
      '\nTest for ' + result.options.url + ' \t ' + colors.red('[FAILED]') +
      '\n-----------------------------------------------\n'
    );
    console.log(result.msg);
    console.log('Summary: ' + result.summary);
  } else {
    console.log(
      '\n-----------------------------------------------' +
      '\nTest for ' + result.options.url + ' \t ' + colors.green('[PASSED]') +
      '\n-----------------------------------------------\n'
    );
    console.log(result.msg);
    console.log('Summary: ' + result.summary);
  }
});

TODO

  • Remove the need for a --url flag. Instead just assume that whatever follows perfbudget is the URL.
  • Better Node.js intergration

Downloads/wk

10

GitHub Stars

20

LAST COMMIT

7yrs ago

MAINTAINERS

2

CONTRIBUTORS

1

OPEN ISSUES

1

OPEN PRs

0
VersionTagPublished
0.0.9
latest
7yrs ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate