is-binary-buffer
Returns true if a buffer is binary. Takes a buffer and does not read from the file system.
file-is-binary
Returns true if a file is binary. Checks the actual contents, since extensions are not reliable. Basic wrapper for isbinaryfile to support vinyl files.
istextorbinary
Determine if a filename and/or buffer is text or binary. Smarter detection than the other solutions.
file-type
Detect the file type of a file, stream, or data