mattriley / node-duplicate-file-finder

Finds duplicate files across given directories without hashing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate File Finder

88.84% cov 216 sloc 24 files 2 deps 11 dev deps

Finds duplicate files across given directories without hashing.


Table of Contents

Install

npm install duplicate-file-finder

Usage

const { findDuplicates } = require('duplicate-file-finder');
const sourcePath = 'photos'; // defaults to current directory.
const searchPaths = ['more-photos', 'even-more-photos']; // defaults to empty.
const duplicates = findDuplicates({ sourcePath, searchPaths }).then(duplicates => {
    // do something with duplicates.
});

duplicates is a data structure like:

[
    [
        'photos/family.jpg',
        'more-photos/copy-of-family.jpg',
        'even-more-photos/another-copy-of-family.jpg'
    ],
    [
        'photos/pets.jpg',
        'more-photos/copy-of-pets.jpg'
    ]
]

Architecture

Can't see the diagram? View it on GitHub

graph TD;
    effects-->strategies;
    effects-->lib;
    effects-->io;
    commands-->strategies;
    commands-->effects;
    commands-->lib;
Loading

This diagram was generated with Module Composer


About

Finds duplicate files across given directories without hashing.


Languages

Language:JavaScript 96.9%Language:Shell 3.1%