npm / file-type
file-type
What changed in file-type 21 to 22, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
11 breaking4 security10 new APIs and options1 tooling7 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initfile-type 2220 changes
Breaking changes 11
Use this type in place of the removed ReadableStreamWithFileType type.
The MIME type for lz files is now application/lzip instead of application/x-lzip.
Apple Alias now uses application/x-ft-apple.alias instead of application/x.apple.alias.
Draco files now use application/x-ft-draco instead of application/vnd.google.draco.
fbx files now use application/x-ft-fbx instead of application/x.autodesk.fbx.
The MIME type for lnk files is now application/x-ms-shortcut instead of application/x.ms.shortcut.
Sub-exports have been removed; import everything directly from file-type.
Now accepts only a web ReadableStream; convert Node.js streams with Readable.toWeb().
Now accepts only a web ReadableStream; convert Node.js streams with Readable.toWeb().
Node.js 22 is now required to use file-type.
This type has been removed; use AnyWebReadableByteStreamWithFileType instead.
New APIs and options 4
Adds support for detecting Core Audio Format (CAF) files.
Adds support for detecting DSDIFF files.
File-type detection now supports ISO 9660 files.
Detection now supports Apple iWork files: Keynote, Pages, and Numbers.
Tooling 1
Warnings for the intentional runtime import are suppressed in Vite and webpack builds.
Fixes and other changes 4
Fixes UTF-16 LE text being detected as MPEG audio.
Fixes ZIP detection on Node.js 24 for entries with a data descriptor.
Works around esbuild resolving Node-only imports, helping developers bundle file-type with esbuild.
Streamed OOXML files are no longer detected as zip.
file-type 2113 changes
Security 4
The parser was hardened; the notes do not specify further details.
file-type: ZIP Decompression Bomb DoS via [Content_Types].xml entry
Fixes a ZIP bomb vulnerability in known-size ZIP probing.
file-type affected by infinite loop in ASF parser on malformed input with zero-size sub-header
New APIs and options 6
Adds support for Mach-O Universal (Fat) binaries and additional architectures.
Adds support for detecting JMP files.
Adds support for detecting SPSS data files.
Adds support for detecting Windows registry hive files.
Adds support for detecting Windows registry files.
Adds support for detecting gunzipped tarball files.
Fixes and other changes 3
Fixes bound recursive BOM and ID3 detection.
Fixes handling of partial Gunzip files.
Fixes handling of partial unzip.