duplicate-files-fast
Find duplicate files in folder
Last updated 2 years ago by aljorhythm .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install duplicate-files-fast 
SYNC missed versions from official npm registry.

duplicate-files

Find duplicate files in folder

Algo

Walk through all files in directory and also recursively in sub-directories, files are mapped with respect to their hashes. Hashes that are associated with more than 1 files are duplicates.

installation

npm i -g duplicate-files-fast

run

Find out which files are duplicates Output is in json format duplicate-files-fast --directory <directory> --extensions <ext1>,<ext2>

Remove files mode. Files except the first found file is kept.

  • Removes duplicate duplicate-files-fast --directory <directory> --remove

  • Dry run mode, prints files to be deleted without deleting duplicate-files-fast --directory <directory> --remove --dryrun

code

var DuplicateFiles = require('duplicate-files-fast')

var finder = new DuplicateFiles()

var directory = '.'
var options = {
  extensions : ['js']
}

finder.findDuplicates(directory, options).then((duplicates) => {
  duplicates.forEach(function (duplicate) {
    console.log('duplicate', duplicate)
  }, this)
}, (err) => {
  console.log('Error: ', err.error)
})

Current Tags

  • 1.1.3                                ...           latest (2 years ago)

4 Versions

  • 1.1.3                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |