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

screen-streamer

v0.4.2

Published

Continuously takes screenshots and returns them as png or jpeg buffers

Readme

screen-streamer

This module continuously takes screenshots and returns them as png or jpeg buffers. It uses FFMPEG with x11grab format support so make sure to have it installed.

Installation

npm install screen-streamer

Syntax

screenStreamer(options[, callback])

options — is an object literal with the following properties

  • duration[Integer] duration of screen capturing in seconds; default: 86400
  • fps[Integer] number of frames per second to capture; default: 1
  • width[Integer] the width of screen area to capture; required
  • height[Integer] the height of screen area to capture; required
  • offsetX[Integer] the horizontal offset of screen area to capture; default: 0
  • offsetY[Integer] the vertical offset of screen area to capture; default: 0
  • maxWidth[Integer] the maximum width of the output image; default: -1, means no scaling
  • maxHeight[Integer] the maximum height of the output image; default: -1, means no scaling
  • display[String] the display id; default: "0.0"
  • format[String] the format of the image to return, either 'png' or 'jpeg'; default: 'png'
  • quality[Integer] the jpeg image quality, from 1 (highest) to 100 (lowest); default: 1

callback — a callback function to pass the result Buffer to: function(err, buffer){ ... } if ommited then a call to screenStreamer function will return a Stream

Example

The code below takes a screenshot from main display every second during 10 seconds and saves it to "screenshot_%d.png"

var screenStreamer = require('screen-streamer');
var fs = require('fs');
var fileIndex = 0;

screenStreamer({
    width: 1024,
    height: 768,
    fps: 1,
    duration: 10,
    format: 'png'
  }, function(err, buffer){
    if (err) throw err;
  
    fs.writeFile('screenshot_' + fileIndex++ + '.png', buffer, function (err) {
      if (err) throw err;
    });
  });

This example shows how to use screenStreamer as a Stream

var screenStreamer = require('screen-streamer');
var fs = require('fs');

screenStreamer({
    width: 1024,
    height: 768,
    fps: 1,
    duration: 10,
    format: 'png'
  }).pipe(fs.createWriteStream('./screenshot.png'));