npm / file-type
file-type
What changed in file-type 10 to 22, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
41 breaking4 security34 new APIs and options4 behavior and defaults1 tooling20 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initfile-type 2221 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.
Security 1
EBML header traversal is hardened with a bounded tokenizer view.
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 2121 changes
Breaking changes 4
Detection support for Adobe Illustrator (.ai) files has been dropped.
The Apache Arrow MIME type was corrected to its formal IANA registration.
The Apache Parquet MIME type was corrected to its formal IANA registration.
Node.js 20 is now required to use file-type.
Security 3
The parser was hardened; the notes do not specify further details.
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 8
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.
Options can now be passed directly to exported functions.
A new mpegOffsetTolerance option is available.
Fixes and other changes 6
Fixes bound recursive BOM and ID3 detection.
Fixes handling of partial Gunzip files.
Fixes handling of partial unzip.
The FLAC MIME type was corrected to its formal IANA registration.
The Matroska video MIME type was corrected to its formal IANA registration.
Detection of some PAX TAR formats was fixed.
file-type 2013 changes
Breaking changes 2
MIME-type and extension enumeration in types was dropped.
NodeFileTypeParser was removed in favor of using FileTypeParser on all platforms.
New APIs and options 10
Support was added for Microsoft Word templates.
FileTypeParser#detectors is now accessible through the API.
Support was added for Java archive files.
Support was added for the .lz4 file format.
Support was added for MSOffice macro-enabled documents and templates.
Support was added for OpenDocument graphics and templates.
Support was added for Microsoft PowerPoint templates.
Support was added for Microsoft Excel templates with macros.
Support was added for Microsoft Excel templates.
Support was added for ZIP decompression using @tokenizer/inflate.
Fixes and other changes 1
Detection of Nikon RAW NEF (Tiff) format was improved.
file-type 192 changes
Breaking changes 2
The MIME type for .wav files changes from audio/vnd.wave to audio/wav.
Node.js 18 is now required to use file-type.
file-type 181 changes
Breaking changes 1
Node.js 14 is now required to use file-type.
file-type 1716 changes
Breaking changes 10
The /browser sub-export was removed; browser support is included by default.
Use the named export fileTypeFromBuffer instead of the default export's fromBuffer.
Use the named export fileTypeFromFile instead of the default export's fromFile.
Use the named export fileTypeFromStream instead of the default export's fromStream.
Use the named export fileTypeFromTokenizer instead of the default export's fromTokenizer.
Use the named export fileTypeStream instead of the default export's stream.
The package now requires Node.js 12.20.
The package is now pure ESM, changing how developers import it.
Use the named export supportedExtensions instead of the default export's extensions.
Use the named export supportedMimeTypes instead of the default export's mimeTypes.
Behavior and default changes 3
Browser support is now included by default.
Detection now supports both raw and BDAV versions of MPEG-2 Transport Streams.
XML encoding with UTF-8 including a BOM field is supported.
Fixes and other changes 3
The stream() function no longer causes an End-Of-Stream error.
TIFF parsing was improved.
WebM detection was improved.
file-type 162 changes
Breaking changes 1
Detection replaces .wma and .wmv with .asf, the container format.
New APIs and options 1
Adds support for detecting ASCII STL files.
file-type 151 changes
Breaking changes 1
Replaces MSI detection with Microsoft CFB detection, changing the file type reported to developers.
file-type 142 changes
Breaking changes 1
Removed because detection now reads beyond the 4k boundary; use fromFile() for efficient detection.
Fixes and other changes 1
Fixed detecting PNG files with long iTXt chunks.
file-type 135 changes
Breaking changes 4
Browser support moved into a sub-module, so browser users should import this path.
The API was rewritten to be async, non-blocking, support streams as input, and improve file type detection.
Execution now stops after a stream error.
Node.js 10 is now required to use the package.
New APIs and options 1
Adds support for detecting CR3 files.
file-type 128 changes
Breaking changes 1
Node.js 8 is now required.
New APIs and options 3
Adds support for APNG.
Adds support for RAF.
Adds support for RW2.
Fixes and other changes 4
Improves detection of ARW.
Improves detection of DNG.
Improves detection of NEF.
Improves detection of TIF.
file-type 1110 changes
Breaking changes 2
TypeScript users must use
import fileType = require('file-type');instead of the default import.Returns undefined instead of null when there is no match.
New APIs and options 6
Adds support for detecting the ac3 format.
Adds support for detecting the alias format.
Adds support for detecting the lnk format.
Adds support for detecting pre-POSIX tar files.
Adds support for detecting Sony DSF (DSD Stream File) files.
Adds support for detecting the voc format.
Behavior and default changes 1
Reworks MPEG-4 detection and adds support for more MPEG-4 and ISO base media formats.
Fixes and other changes 1
Fixes mp2/mp3 checks so they do not match mp1.
file-type 102 changes
Breaking changes 1
The wmv check is more strict.
New APIs and options 1
Adds support for detecting wma files.