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 🙏

© 2025 – Pkg Stats / Ryan Hefner

puppeteer-modify

v0.1.3

Published

A high-level API to control headless Chrome over the DevTools Protocol

Downloads

3

Readme

由于puppeteer对chrome devtools协议的支持度并不高,同时也缺乏易用性和灵活性,一些实现细节也并不符合预期。计划基于puppeteer进行功能增强,不保证兼容性。

Install

npm install puppeteer-modify

跳过自动下载chromium

对于国内用户,自动下载成功率不高,可以用PUPPETEER_SKIP_CHROMIUM_DOWNLOAD参数跳过自动下载。 可以单独下载chromium,或使用chrome代替。通过配置项launch.executablePath指定启动路径即可。

推荐源:https://npm.taobao.org/mirrors/chromium-browser-snapshots/

npm i puppeteer-modify --PUPPETEER_SKIP_CHROMIUM_DOWNLOAD

扩展API

class: Page

page.touchScroll(x, y, options) 新增

通过touch滚动页面至指定的可视坐标

  • x Number 目标x坐标

  • y Number 目标y坐标

  • options Object

    • interval Number 连续滑动的时间间隔,默认2000,单位ms

page.$touchScroll(selector, options) 新增

通过touch方式,滚动页面至指定元素可视区

  • selector String CSS选择器字符串

  • options Object

    • steps Number touchmove的触发次数,默认50
    • interval Number 连续滑动的时间间隔,默认2000,单位ms

page.scroll(x, y) 新增

滚动页面,使指定元素位于可视区

  • x Number 相对于浏览器窗口x坐标

  • y Number 相对于浏览器窗口y坐标

page.$scroll(selector) 新增

滚动页面,使指定元素位于可视区

  • selector String CSS选择器字符串

class: Mouse

mouse.click(x, y, options) 增强,兼容原版

新增模拟鼠标移动轨迹,原click可能出于效率考虑,只会触发一次mousemoved

click操作中已经包含了move,多数情况下不再需要单独模拟move操作,除非只移动鼠标而不需要点击

  • options Object
    • steps Number mousemoved事件的触发次数,默认20

mouse.move(x, y, options) 增强,兼容原版

将steps默认值改为20,原值为1,即只触发一次。移动距离相同时,触发次数越少,对应的移动速度越快

  • options Object
    • steps Number 触发mousemoved事件的次数,默认值20

mouse.scroll(x, y, step) 新增

滚动至指定坐标,目前仅支持纵向滚动

  • x Number 横向坐标,0

  • y Number 纵向坐标

  • step Number 步长

class: Touchscreen

touchscreen.slide({start, end, steps}) 新增

模拟touch单点滑动手势

  • start Object
    • x Number touchstart x坐标
    • y Number touchstart y坐标
  • end Object
    • x Number touchend x坐标
    • y Number touchend y坐标
  • steps Number touchmove的触发次数
  • delay Number 触点释放前的停留时间,用于滑动惯性控制