From a5bde75afef616c9cb16b37844ebbb8025b7a01e Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 16 Jul 2024 23:50:30 +0200 Subject: [PATCH] Update readme.md --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 734821ff..4016f1f0 100644 --- a/readme.md +++ b/readme.md @@ -127,10 +127,12 @@ Type: `Uint8Array | ArrayBuffer` A buffer representing file data. It works best if the buffer contains the entire file. It may work with a smaller portion as well. ### fileTypeFromFile(filePath) + Detect the file type of a file path. This is for Node.js only. -To read from a [File](https://developer.mozilla.org/docs/Web/API/File), please see [fileTypeFromBlob(blob)](#filetypefromblobblob). + +To read from a [`File`](https://developer.mozilla.org/docs/Web/API/File), see [`fileTypeFromBlob()`](#filetypefromblobblob). The file type is detected by checking the [magic number](https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files) of the buffer.