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 🙏

© 2026 – Pkg Stats / Ryan Hefner

grabber

v0.0.2

Published

Take screenshots of web pages.

Readme

grabber

Installation

See sharp's instructions for installing libvips. Sharp is used to resize screenshots and turn them into JPEG, PNG or WebP images.

After that a simple npm install grabber should do the trick. ChromeDriver is straight-forward to install via npm install, but if you want to use Firefox to take screenshots you'll have to be running Selenium server.

Try out some of these guides for getting Xvfb and Selenium running so that you can take "headless" screenshots in a Linux environment. You probably don't want to be screenshotting in OSX or Windows or a real (non-framebuffer) X server because the browser window is going to pop up.

Limitations

Both Firefox and Chrome seem to have the limitation that you can't resize the browser window to be larger than the screen, so you're limited by your screen dimensions. In Linux you can probably get around this to some extent using Xvfb.

Chrome cannot take a screenshot of the full page and will only screenshot the visible portion. Firefox can screenshot the entire page, but this library doesn't allow for that just yet.

Usage

grabber = require 'grabber'

chromeOptions =
  hostname: "127.0.0.1"
  port: 9515
  pathname: "/wd/hub"
  args: [
    "--url-base=/wd/hub"
    "--port=" + 9515
    "--verbose"
  ]

browser = grabber.chrome.init(chromeOptions, (err, browser) ->
  return console.error(err) if err

  screenshotOptions =
    url: 'http://www.google.com/'
    width: 1024
    height: 768
    resize: 512
    quality: 80

    # see browser.waitForConditionInBrowser in wd
    condition: "document.querySelectorAll('.foo').length > 0"

    # see wd for documentation on browser
    cleanup: (browser, cb) ->
      # Do something with browser like dismiss popups or scroll down to the
      # button of the page or whatever you want to do before you take a
      # screenshot.
      cb() # remember to call cb() when you're done

    # save the file
    out: 'google.jpg'

  grabber.commands.screenshot browser, screenshotOptions, (err, image) ->
    return console.error(err) if err
    # image now contains an instance of a sharp image object thing that you can
    # then do something with if you want. Probably not necesary if you passed
    # in an out parameter

Examples

Most of the action happens in the examples/ directory.

chrome_screenshot.coffee and firefox_screenshot.coffee are command-line utilities to take screenshots.

The parameters are url, width, height, resize, quality, crop. The CLI utilities also take an --out=filename.(png|jpeg|webp) parameter and support a -t parameter for testing with Thing's settings.