DragonOfMath / dupe-images

Node.js package for finding and removing duplicate image files with extreme precision
MIT License
11 stars 3 forks source link
considered-duplicates dupe-images duplicate-images duplicates nodejs remove-duplicates

dupe-images

Node.js package for finding and removing duplicate images with extreme precision. Uses a modified version of require-all to read a directory and jimp to compare image data.

Runtime duration is O(n^2) at the worst, but significantly speeds up the more duplicates or similar images there are.

Installation

npm install dupe-images --save

Usage

Require dupe-images in your code and call findDuplicates() on your given directory, which returns a Promise resolving to an array of groups of duplicates.

var {findDuplicates, removeDuplicates} = require('dupe-images');
findDuplicates('./folder').then(duplicates => ...)

You can provide the same options as require-all uses in a second argument object.

findDuplicates('./folder', {recursive: true, exact: true})

Options:

Using removeDuplicates() is the same structure as findDuplicates(), however you are given even more options:

removeDuplicates() returns an Promise that resolves to an object containing two array properties: retained for files that were kept/renamed, and removed for files that were deleted.