unstale

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 init

@unstale/cli on npm

file-type 2221 changes

Breaking changes 11

  • Use this type in place of the removed ReadableStreamWithFileType type.

    22.0.0release notes

  • The MIME type for lz files is now application/lzip instead of application/x-lzip.

    22.0.0release notes

  • Apple Alias now uses application/x-ft-apple.alias instead of application/x.apple.alias.

    22.0.0release notes

  • Draco files now use application/x-ft-draco instead of application/vnd.google.draco.

    22.0.0release notes

  • fbx files now use application/x-ft-fbx instead of application/x.autodesk.fbx.

    22.0.0release notes

  • The MIME type for lnk files is now application/x-ms-shortcut instead of application/x.ms.shortcut.

    22.0.0release notes

  • Sub-exports have been removed; import everything directly from file-type.

    22.0.0release notes

  • Now accepts only a web ReadableStream; convert Node.js streams with Readable.toWeb().

    22.0.0release notes

  • Now accepts only a web ReadableStream; convert Node.js streams with Readable.toWeb().

    22.0.0release notes

  • Node.js 22 is now required to use file-type.

    22.0.0release notes

  • This type has been removed; use AnyWebReadableByteStreamWithFileType instead.

    22.0.0release notes

Security 1

  • EBML header traversal is hardened with a bounded tokenizer view.

    22.3.0release notes

New APIs and options 4

  • Adds support for detecting Core Audio Format (CAF) files.

    22.2.0release notes

  • Adds support for detecting DSDIFF files.

    22.2.0release notes

  • File-type detection now supports ISO 9660 files.

    22.1.0release notes

  • Detection now supports Apple iWork files: Keynote, Pages, and Numbers.

    22.0.0release notes

Tooling 1

  • Warnings for the intentional runtime import are suppressed in Vite and webpack builds.

    22.1.0release notes

Fixes and other changes 4

  • Fixes UTF-16 LE text being detected as MPEG audio.

    22.0.2release notes

  • Fixes ZIP detection on Node.js 24 for entries with a data descriptor.

    22.0.2release notes

  • Works around esbuild resolving Node-only imports, helping developers bundle file-type with esbuild.

    22.0.1release notes

  • Streamed OOXML files are no longer detected as zip.

    22.0.0release notesrelease notes

file-type 2121 changes

Breaking changes 4

  • Detection support for Adobe Illustrator (.ai) files has been dropped.

    21.0.0release notes

  • The Apache Arrow MIME type was corrected to its formal IANA registration.

    21.0.0release notes

  • The Apache Parquet MIME type was corrected to its formal IANA registration.

    21.0.0release notes

  • Node.js 20 is now required to use file-type.

    21.0.0release notes

Security 3

New APIs and options 8

  • Adds support for Mach-O Universal (Fat) binaries and additional architectures.

    21.3.0release notes

  • Adds support for detecting JMP files.

    21.2.0release notes

  • Adds support for detecting SPSS data files.

    21.2.0release notes

  • Adds support for detecting Windows registry hive files.

    21.1.0release notes

  • Adds support for detecting Windows registry files.

    21.1.0release notes

  • Adds support for detecting gunzipped tarball files.

    21.1.0release notes

  • Options can now be passed directly to exported functions.

    21.0.0release notes

  • A new mpegOffsetTolerance option is available.

    21.0.0release notes

Fixes and other changes 6

  • Fixes bound recursive BOM and ID3 detection.

    21.3.2release notes

  • Fixes handling of partial Gunzip files.

    21.1.1release notes

  • Fixes handling of partial unzip.

    21.1.0release notes

  • The FLAC MIME type was corrected to its formal IANA registration.

    21.0.0release notes

  • The Matroska video MIME type was corrected to its formal IANA registration.

    21.0.0release notes

  • Detection of some PAX TAR formats was fixed.

    21.0.0release notes

file-type 2013 changes

Breaking changes 2

  • MIME-type and extension enumeration in types was dropped.

    20.0.0release notes

  • NodeFileTypeParser was removed in favor of using FileTypeParser on all platforms.

    20.0.0release notes

New APIs and options 10

  • Support was added for Microsoft Word templates.

    20.0.0release notes

  • FileTypeParser#detectors is now accessible through the API.

    20.0.0release notes

  • Support was added for Java archive files.

    20.0.0release notes

  • Support was added for the .lz4 file format.

    20.0.0release notes

  • Support was added for MSOffice macro-enabled documents and templates.

    20.0.0release notes

  • Support was added for OpenDocument graphics and templates.

    20.0.0release notes

  • Support was added for Microsoft PowerPoint templates.

    20.0.0release notes

  • Support was added for Microsoft Excel templates with macros.

    20.0.0release notes

  • Support was added for Microsoft Excel templates.

    20.0.0release notes

  • Support was added for ZIP decompression using @tokenizer/inflate.

    20.0.0release notes

Fixes and other changes 1

  • Detection of Nikon RAW NEF (Tiff) format was improved.

    20.0.0release notes

file-type 192 changes

Breaking changes 2

  • The MIME type for .wav files changes from audio/vnd.wave to audio/wav.

    19.0.0release notes

  • Node.js 18 is now required to use file-type.

    19.0.0release notes

file-type 181 changes

Breaking changes 1

file-type 1716 changes

Breaking changes 10

  • The /browser sub-export was removed; browser support is included by default.

    17.0.0release notes

  • Use the named export fileTypeFromBuffer instead of the default export's fromBuffer.

    17.0.0release notes

  • Use the named export fileTypeFromFile instead of the default export's fromFile.

    17.0.0release notes

  • Use the named export fileTypeFromStream instead of the default export's fromStream.

    17.0.0release notes

  • Use the named export fileTypeFromTokenizer instead of the default export's fromTokenizer.

    17.0.0release notes

  • Use the named export fileTypeStream instead of the default export's stream.

    17.0.0release notes

  • The package now requires Node.js 12.20.

    17.0.0release notes

  • The package is now pure ESM, changing how developers import it.

    17.0.0release notes

  • Use the named export supportedExtensions instead of the default export's extensions.

    17.0.0release notes

  • Use the named export supportedMimeTypes instead of the default export's mimeTypes.

    17.0.0release notes

Behavior and default changes 3

  • Browser support is now included by default.

    17.0.0release notes

  • Detection now supports both raw and BDAV versions of MPEG-2 Transport Streams.

    17.0.0release notes

  • XML encoding with UTF-8 including a BOM field is supported.

    17.0.0release notes

Fixes and other changes 3

file-type 162 changes

Breaking changes 1

  • Detection replaces .wma and .wmv with .asf, the container format.

    16.0.0release notes

New APIs and options 1

file-type 151 changes

Breaking changes 1

  • Replaces MSI detection with Microsoft CFB detection, changing the file type reported to developers.

    15.0.0release notes

file-type 142 changes

Breaking changes 1

  • Removed because detection now reads beyond the 4k boundary; use fromFile() for efficient detection.

    14.0.0release notes

Fixes and other changes 1

  • Fixed detecting PNG files with long iTXt chunks.

    14.0.0release notes

file-type 135 changes

Breaking changes 4

  • Browser support moved into a sub-module, so browser users should import this path.

    13.0.0release notes

  • The API was rewritten to be async, non-blocking, support streams as input, and improve file type detection.

    13.0.0release notes

  • Execution now stops after a stream error.

    13.0.0release notes

  • Node.js 10 is now required to use the package.

    13.0.0release notes

New APIs and options 1

file-type 128 changes

Breaking changes 1

New APIs and options 3

Fixes and other changes 4

file-type 1110 changes

Breaking changes 2

  • TypeScript users must use import fileType = require('file-type'); instead of the default import.

    11.0.0release notes

  • Returns undefined instead of null when there is no match.

    11.0.0release notes

New APIs and options 6

  • Adds support for detecting the ac3 format.

    11.0.0release notes

  • Adds support for detecting the alias format.

    11.0.0release notes

  • Adds support for detecting the lnk format.

    11.0.0release notes

  • Adds support for detecting pre-POSIX tar files.

    11.0.0release notes

  • Adds support for detecting Sony DSF (DSD Stream File) files.

    11.0.0release notes

  • Adds support for detecting the voc format.

    11.0.0release notes

Behavior and default changes 1

  • Reworks MPEG-4 detection and adds support for more MPEG-4 and ISO base media formats.

    11.0.0release notes

Fixes and other changes 1

  • Fixes mp2/mp3 checks so they do not match mp1.

    11.0.0release notes

file-type 102 changes

Breaking changes 1

New APIs and options 1