Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Use Node.js filesystem metadata to flag large files, use sharp to inspect image dimensions and format, and compare SHA-256 hashes to find byte-for-byte duplicates. The first pass can remain read-only: it reads files and prints a report, without deleting, renaming, rewriting, or compressing assets. Set size and dimension limits to suit your project; there is no universal cutoff for an “oversized” image.

What the audit can—and cannot—tell you

File size and pixel dimensions are different signals. Filesystem metadata gives you a file’s byte count; image metadata provides properties such as format, width, and height. A file can be large in bytes without having especially large dimensions, or have many pixels while remaining relatively small because of its encoding.

A matching SHA-256 digest for files of the same size is a practical way to identify byte-identical files. It will not find images that look alike but differ because they were resized, re-encoded, or had metadata changed. This is an exact-duplicate audit, not a visual-similarity search.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Nor does a high pixel count prove that an image is wasteful. Original artwork, high-density displays, zoomable images, and print workflows may require large source files. Treat findings as a review list, not automatic deletion instructions.

#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Choose scope and thresholds before scanning

Pick asset roots deliberately

Scan only the directories relevant to your project. Exclude dependencies, generated files, caches, and build output unless you specifically want them included. Keep paths relative to the project root in the report so findings can be reviewed and shared.

A conservative traversal should inspect regular files and avoid following symbolic links into other locations unintentionally. Decide whether linked files are skipped or handled explicitly, and record that policy. Permissions and files changing during the scan can cause individual errors; report these rather than silently treating an incomplete scan as a clean result.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Make limits project configuration

Set separate configurable limits for file bytes and image dimensions, and include the applied values in the report. The Node.js and sharp documentation describes APIs and supported capabilities, not a standard definition of an oversized asset. Choose limits based on your delivery requirements and the kinds of originals your project needs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Inspect image metadata without decoding pixels

The sharp metadata API reads header information without decoding compressed pixel data. It can provide format, width, height, page count, and orientation. This makes it useful for a first-pass inventory, though the scan still performs file reads and consumes I/O; hashing can add CPU and I/O work.

Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

sharp lists JPEG, PNG, WebP, GIF, AVIF, TIFF, and SVG as readable formats on its project homepage. Limit the audit to formats your chosen implementation supports, and make that coverage visible in the report. Do not imply that an unrecognized or unsupported file was fully inspected.

For animated or multipage files, capture the page count when available and state how the audit treats such files. A single width and height do not describe every frame or page. Orientation can also affect displayed dimensions: sharp documents autoOrient metadata for dimensions adjusted to account for orientation.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Find exact duplicates with streamed SHA-256 hashes

Hashing every file is unnecessary for an initial exact-match pass. Read filesystem sizes, group paths by byte count, and hash only files in groups with more than one member. Equal size narrows candidates; a matching digest identifies an exact byte-for-byte match in practice.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Node.js documents crypto.createHash() and demonstrates hashing a file stream with SHA-256 in its crypto documentation. Streaming avoids loading each whole file into memory at once. For each matching group, list every path and digest; do not nominate or remove a “duplicate” automatically.

Best Value
Sale
UnionSine 500GB Ultra Slim Portable External Hard Drive HDD-USB 3.0
  • [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
  • 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
  • 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
  • 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
  • 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep the first run read-only

  1. Configure roots, exclusions, formats, and limits. Choose directories to scan, decide how symbolic links are treated, and set byte and dimension thresholds before running.
  2. Enumerate files and read their sizes. Use filesystem metadata for byte counts rather than extensions or filenames. Retain project-relative paths and handle unreadable or changing files as per-file errors.
  3. Read metadata for supported image candidates. Request format, dimensions, page count when present, and relevant orientation information. Do not decode or transform pixels just to build the inventory.
  4. Bucket by byte size, then hash candidate files. Stream files in repeated-size buckets through SHA-256 and group paths with identical digests.
  5. Print the report or write it to a separate destination. Include findings, scan coverage, errors, and configured thresholds. Do not add deletion, renaming, compression, or rewriting to this initial audit.

Keep report output distinct from the assets being scanned. Printing JSON to stdout is a straightforward option for later processing; if you write a report file, require an explicit path outside the asset set or otherwise ensure it cannot overwrite a scanned file.

Handle file operations directly and catch failures rather than checking access in advance. The Node.js filesystem documentation warns: “Do not use fs.access() to check for the accessibility of a file before calling fs.open(), fs.readFile() or fs.writeFile(). Doing so introduces a race condition, since other processes may change the file’s state between the two calls.” A path can change between a check and a later operation.

Make the report useful for review

A report should distinguish flagged assets from files the audit could not inspect. Include:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Relative path, file size in bytes, and the limits applied.
  • Image format, width, height, and page count when available.
  • Whether a file exceeded the byte threshold, a dimension threshold, or both.
  • SHA-256 digest and all paths in each exact-duplicate group.
  • Counts for scanned files, supported image files, skipped files, and errors, with reasons where practical.

Use measured values rather than labels alone: a reviewer needs to know how far an asset exceeds a configured limit. Keep scan failures visible so that “no findings” is not mistaken for “all files were checked.”

Runtime and package considerations

Filesystem and crypto functionality come from Node.js built-in modules; sharp is an npm package. The sharp homepage describes support for runtimes providing Node-API v9, including Node.js 20.9.0 and later. Check the current sharp package page and project documentation when choosing a version, since package compatibility can change.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$229.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$208.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.