If possible, use a daemon on Linux. Let it watch a particular folder and generate SHA hashes for each file that gets stored in that folder. Then just access and compare each hash of the files you need to check for equality.
It has some advantages. When using Node.js, it doesn't block the event loop when hashing huge files. My daemon follows symlinks. Copying a symlink into that watched folder cost virtually no time.
I had used a sperate Node.js process for that task before I found the daemon thing.
Watching a folder for file change events then loading the file and hashing it via crypto module bundled with Node.js. Comparing the hashes answers the question for equality.
Maybe someone published a ready to go package already, but this task is easier than trying to find a suitable solution on npmjs.org ;-)
Edit: I just remembered that I used https://github.com/h2non/jsHashes for the Node.js based hashing project. It is fast, the API is simple, and it has no dependencies.