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

raster-eyes

v1.2.1

Published

Yet another web page screenshot service

Readme

raster-eyes

Raster Eyes is a Node library for taking screenshots of web pages using PhantomJS, a headless web browser built on top of the WebKit rendering engine. It can be used as a fallback renderer for old and/or broken browsers, or those with JavaScript disabled.

Installation

Install with npm:

npm install raster-eyes

Server

Run the raster-eyes server.
Usage: raster-eyes [options]

Examples:
  node server.js --port 8100           run on port 8001
  node server.js --cache node-cache    use node-cache as the request cache


Options:
  --host   Listen on this hostname (default: 127.0.0.1)                         
  --port   Listen on this port (default: 9000)                                  
  --cache  Load this module as request cache.
           Alternatively: --cache.module=name --cache.option=option             

API

First, require the raster-eyes node module:

var re = require('raster-eyes');

re.capture(url, [options,] callback)

Asynchronously takes a screenshot of the given url using the following possible options:

  • viewport: the viewport rectangle, expressed either as a string {width}x{height} or an object with width and height properties (default: 1024x768).
  • cliprect: the region of the page to capture, either in the string form {left}x{top}x{width}x{height} or an object with left, top, width and height properties.
  • delay: how many milliseconds to wait before capturing (default: 250).
  • zoom: the zoom factor (default: 1)

Web Services: re.web

The raster-eyes module's web namespace contains two functions for turning re.capture() into web services:

re.web.server(options, callback)

Creates an express web server with the raster-eyes middleware and the following server-specific options:

  • host: the host on which to listen (default: 127.0.0.1, or process.env.HOST)
  • port: the port on which to listen (default: 9000, or process.env.PORT)
  • path: the path at which to mount the capture middleware (default: /raster-eyes/)

re.web.middleware(options)

The raster-eyes middleware is an express-compatible GET request handler that parses the path and query string for capture options and produces HTTP image responses when all goes well (or 500 error responses when it doesn't). It accepts the following options in addition to the the capture options:

  • cache: an optional cache object with the following methods, each of which should implement node-style callbacks, e.g. node-cache:
    • cache.get(key, callback)
    • cache.set(key, value, callback)
URLs

Raster Eyes' middleware looks at URLs relative to the mount point and assumes one of the following forms:

{url}?{options}
?url={url}&{options}

The first form allows you to just GET /raster-eyes/google.com from a server with the default options, but if the URL you're trying to access has query string parameters you'll need to escape it (e.g. with the encodeURI() global function in most JavaScript environments) first, otherwise the query string will be parsed as options for re.capture(). You'll need to use the second form (passing the URL as the url query string parameter) if you wish to provide any additional options.

URL Options

You can specify any of the options that re.capture() takes as a query string parameter, e.g.:

google.com?viewport=800x600
18f.gsa.gov?selector=.logo