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

shotter

v1.3.4

Published

takes screenshots on several pages and visualizes the differences

Downloads

13

Readme

shotter Build Status

Shotter takes a list of specified URLs and takes screenshots of the rendered page. The screenshots are arranged in sessions. When a previous session exists, shotter will create a diff between the screenshots of one URL and combine the two screenshots and the diff to one result.

This will result in an image the looks similar to this one (click to enlarge):

installation

npm i shotter -g

Will install the shotter module in the global namespace

usage

global installation

Simply run shotter in your working directory (see specification).

Parameters:

    --concurrency, -c  specifies the number of parallel threads that are 
                       used to render screenshots/diffs/results
                       defaults to 1

local installation

The module can also be used as a direct dependency. The returned instance is a event emitter that will emit a progress event with the percentage as a value. Also an initialize event will be fired.

(The initialize and the progress event could be used for the implementation of a progress bar)

var shotter = require('shotter');

var creator = shotter(process.cwd(), (error) => {
    if (error) console.log(error)

    console.log('I\'m done!')
})

creator
    .on('initialize', () => console.log('initialize'))
    .on('progress', (percentage) => console.log(percentage))

specification

Shotter works in a working space and treats every directory in this working space as a distinct project. Each project has its own set of URLs that are specified via a .spec.json file. Under a certain project each session hat its own directory, denoted by a timestamp. In a session directory all the screenshots can be found, additionally the diffs to the previous session are stored as well as the summaries.

workingSpace
  fooProject
    .spec.json
    20140920000000
      d4da96058f7e3c5f0003544304d65dc4.png
    20140921000000
      d4da96058f7e3c5f0003544304d65dc4.png
      results
        d4da96058f7e3c5f0003544304d65dc4.png
      diffs
        d4da96058f7e3c5f0003544304d65dc4.png
    20140922000000
      d4da96058f7e3c5f0003544304d65dc4.png
      results
        d4da96058f7e3c5f0003544304d65dc4.png
      diffs
        d4da96058f7e3c5f0003544304d65dc4.png

In the session 20140920000000 there are no diffs and results to be found because there hasn't been a previous session.

.spec.json

In the .spec.json file the URLs that should be used are specified:

{
  "urls": [
    "fooUrl", 
    "barUrl"
  ]
}

built with

requirements

  • ImageMagick needs to be installed
  • Since some ES2015 features are used the minimal supported node version is 4.x