| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2026-03-26 | 1.7 kB | |
| v22.0.0 source code.tar.gz | 2026-03-26 | 68.7 MB | |
| v22.0.0 source code.zip | 2026-03-26 | 68.8 MB | |
| Totals: 3 Items | 137.5 MB | 0 | |
Breaking
- Requires Node.js 22
- Dropped Node.js
stream.Readablesupport fromfileTypeFromStream()andfileTypeStream() - These now only accept a web
ReadableStream. Migrate withReadable.toWeb()(nodejs.org): ```js // Before import fs from 'node:fs'; fileTypeFromStream(fs.createReadStream('file.mp4'));
// After import fs from 'node:fs'; import {Readable} from 'node:stream'; fileTypeFromStream(Readable.toWeb(fs.createReadStream('file.mp4'))); ```
- Sub-exports (e.g.
file-type/core) have been removed. Import everything fromfile-typedirectly. - The
ReadableStreamWithFileTypetype has been removed. UseAnyWebReadableByteStreamWithFileTypeinstead. - Several MIME types have been corrected or normalized:
| Type | Old MIME | New MIME |
|---|---|---|
lz |
application/x-lzip |
application/lzip |
lnk |
application/x.ms.shortcut |
application/x-ms-shortcut |
| Apple Alias | application/x.apple.alias |
application/x-ft-apple.alias |
fbx |
application/x.autodesk.fbx |
application/x-ft-fbx |
| Draco | application/vnd.google.draco |
application/x-ft-draco |
MIME subtypes prefixed with x-ft- are custom types defined by this package (not IANA-registered).
Improvements
- Added detection for Apple iWork files:
.key(Keynote),.pages(Pages),.numbers(Numbers)
Fixes
- Fixed LibreOffice OOXML files being incorrectly detected as ZIP when reading from streams
https://github.com/sindresorhus/file-type/compare/v21.3.4...v22.0.0