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

grunt-reg-viz

v0.0.6

Published

Compares pictures and shows their differences for visual regression test automation.

Downloads

10

Readme

grunt-reg-viz

NPM version Build Status Coverage Status Dependency Status devDependency Status Built with Grunt

NPM Downloads

Compares pictures and shows their differences for visual regression test automation.

Table of Contents

Installation

You need node >= 4, npm and grunt >= 0.4.5 installed and your project build managed by a Gruntfile with the necessary modules listed in package.json. If you haven't used Grunt before, be sure to check out the [Getting Started] guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

$ npm install grunt-reg-viz --save-dev

Configuration

Add the reg-viz entry with the task configuration to the options of the grunt.initConfig method:

grunt.initConfig({
  'reg-viz': {
    all: {
      expected: 'screenshots/expected',
      actual: 'screenshots/actual',
      different: 'screenshots/different',
      report: 'screenshots/report.html'
    }
  }
});

Default options support the most usual usage scenario:

'reg-viz': {
  options: {
    thresholdRate: null,
    thresholdPixel: null,
    concurrency: null,
    enableAntialiasing: false,
    additionalDetection: 'none',
    force: false
  },
  ...
}

Task Options

force

Type: Boolean Default value: false

If set to true, it suppresses failures, which result from different images, or from other errors. Instead of making the Grunt fail, the errors will be written only to the console.

thresholdRate

Type: Number Default value: null

Rate threshold for detecting change. When the difference ratio of the image is larger than the set rate detects the change.

thresholdPixel

Type: Number Default value: null

Pixel threshold for detecting change. When the difference pixel of the image is larger than the set pixel detects the change. This value takes precedence over thresholdRate.

concurrency

Type: Number Default value: CPU count

How many processes launches in parallel. If omitted, the count of installed CPUs.

enableAntialiasing

Type: Boolean Default value: false

Enable antialiasing. If omitted false.

additionalDetection

Type: String Default value: 'none'

Enable additional difference detection(highly experimental). Select "none" or "client" (default: "none").

Task Data

expected

Type: String Default value: './expected'

Path to the directory with expected images, which will be used as baseline in comparisons.

actual

Type: String Default value: './actual'

Path to the directory with actual images, which will be used as new ones to compare against.

different

Type: String Default value: './different'

Path to the directory with images showing the differences between the baseline and the new images.

report

Type: String Default value: './report.html'

Path to the HTML report file, which will be written after performing all comparisons. One more file will be written to the same directory; the JSON report file. It will share the same name as the HTML report file, just the extension ".json" wil be different.

Loading

Load the plugin in Gruntfile.js:

grunt.loadNpmTasks('grunt-reg-viz');

Build

Call the reg-viz task:

$ grunt reg-viz

or integrate it to your build sequence in Gruntfile.js:

grunt.registerTask('default', ['reg-viz', ...]);

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2018-01-29 v0.0.1 Initial release

License

Copyright (c) 2018-2019 Ferdinand Prantl

Licensed under the MIT license.