It's currently burried in the splitting code, while it could be in its own file:
gather all images of the project
gather all references to images from markdown files
move files closer to the file that embeds it if there's only one
Stretch goals:
accept a function as an option that lets users decide where the image should end up
provides the path of the image and the path of the file(s) that embed it
detect image duplicates (eg. by comparing file hashes) and reduce them to a single file
this could be left to userland by having the function accept an object as return value with a flag to delete the file alongside the path to file to re-use
It's currently burried in the splitting code, while it could be in its own file:
Stretch goals: