
Security News
TC39 Advances Temporal to Stage 4 Alongside Several ECMAScript Proposals
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.
grunt-screenshot-diff
Advanced tools
Compare images taken in different test runs and highlight differences
Compare images taken in different test runs and highlight differences
A grunt plugin that wraps automated-screenshot-diff to automate screenshot comparisons.
This plugin requires Grunt ~0.4.1
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-screenshot-diff --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-screenshot-diff');
In your project's Gruntfile, add a section named screenshot_diff to the data object passed into grunt.initConfig().
grunt.initConfig({
screenshot_diff: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
This task is a multi task, meaning that grunt will automatically iterate over all exec targets if a target is not specified.
Directories to run screenshot comparisons in are specified in the files section of the task configuration, however only src files are used. The most common configuration would be to specify files as an array of paths in which to compare screenshots.
Type: String
Default value: 'v1'
A string used to identify screenshots associated with a previous version to use in the comparison.
Type: String
Default value: 'v2'
A string used to identify screenshots associated with the current version to use in the comparison.
Type: String
Default value: false
A boolean used to control whether not changed scenarios are saved in the generated difference report.
Type: String
Default value: 'html'
One of 'html' or 'json', controls the format of the generated difference report
In this example, we compare screenshots using the default options which generate a difference report between files tagged with v1 and v2 in the screenshots folder.
grunt.initConfig({
screenshot_diff: {
options: {
},
files: ['screenshots'],
},
})
In this example, custom options are used change the tags used to identify the versions, change the output format to json and include unchanged files in the resulting report.
grunt.initConfig({
screenshot_diff: {
options: {
'previous-release': 'prev',
'current-release': 'curr',
'ignore-not-changed': true,
outputFormat: 'json'
},
files: ['screenshots'],
},
})
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.
automated_screenshot_diff so task works in other projects.FAQs
Compare images taken in different test runs and highlight differences
We found that grunt-screenshot-diff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.

Research
/Security News
Since January 31, 2026, we identified at least 72 additional malicious Open VSX extensions, including transitive GlassWorm loader extensions targeting developers.

Research
Six malicious Packagist packages posing as OphimCMS themes contain trojanized jQuery that exfiltrates URLs, injects ads, and loads FUNNULL-linked redirects.