Skip to content

joehand/compare-folder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compare-folder

npm travis standard

check if two directories are the same, with support for custom fs

Currently checks:

  • total file count
  • total size
  • total directory count

Warning: Could have false positives if all the above are the same.

Install

npm install compare-folder

Usage

var compare = require('compare-folder')

compare('dir-one', 'dir-two', function (err, isSame) {
  if (err) throw err

  if (isSame) {
    console.log('Directories are the same.')
  } else {
    console.log('Directories are different.')
  }
})

API

compare(dir1, dir2, [opts], cb)

The dir variables are either paths or {name, fs} for custom fs.

Use custom fs:

var dir1 = {fs: customFs, name: '/'}

TODO:

  • Add options for more in depth checks
    • Check file names
    • Check fs.stat results
    • Check file contents

License

MIT

About

compare two folders with custom fs support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published