Skip to content

Commit 41fcff5

Browse files
committed
Update readme
1 parent a8f6934 commit 41fcff5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

readme.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ We accept contributions for commonly used modern file formats, not historical or
1616
npm install file-type
1717
```
1818

19-
**This package is an ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). For TypeScript + CommonJS, see [`load-esm`](https://github.com/Borewit/load-esm).**
19+
**This package is an ESM package. Your project needs to be ESM too. [Read more](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). For TypeScript + CommonJS, see [`load-esm`](https://github.com/Borewit/load-esm).** If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.
2020

21-
If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.
22-
23-
File type detection is based on binary signatures (magic numbers) and should be treated as a best-effort hint, not a guarantee.
21+
> [!IMPORTANT]
22+
> File type detection is based on binary signatures (magic numbers) and is a best-effort hint. It does not guarantee the file is actually of that type or that the file is valid/not malformed.
23+
>
24+
> Robustness against malformed input is best-effort. When processing untrusted files on a server, use a worker thread with a timeout (e.g., [`make-asynchronous`](https://github.com/sindresorhus/make-asynchronous)) to prevent malformed inputs from potentially blocking the event loop.
2425
2526
## Usage
2627

0 commit comments

Comments
 (0)