file-type-checker
Detect and validate file types by their signatures (✨magic numbers✨)
file-type
Detect the file type of a file, stream, or data
whether
identify file type by file magic numbers.
mmmagic
An async libmagic binding for node.js for detecting content types by data inspection