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

ppts

v1.4.0

Published

performance-puppeteer-tests

Downloads

48

Readme

ppts

performance-puppeteer-tests, based on node and puppeteer, try to measures the indicators of the web performance, including the jsHeapUsedSize, jsHeapTotalSize, firstPaint, firstMeaningfulPaint, domContentLoaded and loadEventEnd.

What's more, ppts can be used to calculate the average and standardDeviation of indicators of the web performance when you repeat a specific number of time. And ppts is also support to choose the specific phone devices to emulate.

See the Usage for more details.

LatestVersion: v1.4.0

What is new:
    v1.4.0: Support webhook function when the outputFormat is json.
    v1.3.0: Change the methods of opening url.
    v1.2.0: Support phone and cache model.
    v1.1.1: Support the measurement of indicators of web performance.

Installation

To install ppts :

npm install -g ppts --registry=https://registry.npm.taobao.org

Measures indicators of the web performance

Measures:
    |  min  |  median  |  max  |  average  |  standardDeviation  |
      最小值    中间值    最大值    平均值            方差

Indicators:
    jsHeapUsedSize             占用的堆的大小
    jsHeapTotalSize            堆占用的总内存
    firstPaint                 白屏时间
    firstMeaningfulPaint       首屏时间
    domContentLoaded           可交互时间
    loadEventEnd               加载完成时间

Usage

To run the application, just use :

ppts <url>

Several options are available to enhance metrics easily. Use -h (--help) to display them.

➜ ppts -h

    Usage: cli <url> [options]

    Description:
        performance-puppeteer-tests

    Author:
        Shaonian <[email protected]>
    
    Options:
        -r, --repeat [n]                     指定加载次数 (default: 5)
        -w, --width [width]                  浏览器首屏的宽度 (default: "1920")
        -H, --height [height]                浏览器首屏的高度 (default: "1080")
        -o, --output-format [output-format]  输出报告格式 (default: "table")
        -c, --custom-path [custom-path]      载入配置文件(default: null)
        --phone [device-name]                是否启用手机模式(default: null)
        --cache                              是否启用浏览器缓存 (default: false)
        --webhook [webhook-url]              是否启用webhook通知(default: null)
        --output-file [output-file]          输出报告文件(default: txt)
        --wait-until [wait-until]            加载完成的标志(default: load)
        --no-headless                        浏览器无头模式(default: true)
        --no-sandbox                         适配Linux无沙盒模式(default: false)
        -h, --help                           output usage information

Setting repeat times

ppts -r 100 https://www.baidu.com

Setting no-headless

ppts https://www.baidu.com --no-headless false

Setting no-sandbox (Run in Linux)

ppts https://www.baidu.com --no-sandbox true

Setting complex actions as extend customs (Such as: login.js)

ppts -c './extend_custom/login.js' https://mubu.com

Setting with cache

ppts https://www.baidu.com --cache true

Setting the webhook

ppts https://www.baidu.com --output-format json --webhook your-webhook-url

Setting with phone mode

ppts https://www.baidu.com --phone 'iPhone X' --no-headless false

Support devices

Blackberry PlayBook
Blackberry PlayBook landscape
BlackBerry Z30
BlackBerry Z30 landscape
Galaxy Note 3
Galaxy Note 3 landscape
Galaxy Note II
Galaxy Note II landscape
Galaxy S III
Galaxy S III landscape
Galaxy S5
Galaxy S5 landscape
iPad
iPad landscape
iPad Mini
iPad Mini landscape
iPad Pro
iPad Pro landscape
iPhone 4
iPhone 4 landscape
iPhone 5
iPhone 5 landscape
iPhone 6
iPhone 6 landscape
iPhone 6 Plus
iPhone 6 Plus landscape
iPhone 7
iPhone 7 landscape
iPhone 7 Plus
iPhone 7 Plus landscape
iPhone 8
iPhone 8 landscape
iPhone 8 Plus
iPhone 8 Plus landscape
iPhone SE
iPhone SE landscape
iPhone X
iPhone X landscape
iPhone XR
iPhone XR landscape
JioPhone 2
JioPhone 2 landscape
Kindle Fire HDX
Kindle Fire HDX landscape
LG Optimus L70
LG Optimus L70 landscape
Microsoft Lumia 550
Microsoft Lumia 950
Microsoft Lumia 950 landscape
Nexus 10
Nexus 10 landscape
Nexus 4
Nexus 4 landscape
Nexus 5
Nexus 5 landscape
Nexus 5X
Nexus 5X landscape
Nexus 6
Nexus 6 landscape
Nexus 6P
Nexus 6P landscape
Nexus 7
Nexus 7 landscape
Nokia Lumia 520
Nokia Lumia 520 landscape
Nokia N9
Nokia N9 landscape
Pixel 2
Pixel 2 landscape
Pixel 2 XL
Pixel 2 XL landscape

Useful Resources