NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #858 most downloaded on npm
Detect the file type of a file, stream, or data
Last release 17 days ago
17 Sep 2026
Release timing varies
gaps range from 9 days to 6 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
172 releases · first in 2014
Fix streamed OOXML files being detected as zip ( #801 ) 1347414
One column per quarter.
Fix ZIP detection on Node.js 24 for entries with a data descriptor f24af84
Fix: Work around esbuild resolving Node-only imports ce4262f
Dropped Node.js stream.Readable support from fileTypeFromStream() and fileTypeStream()
Requires Node.js 22
Dropped Node.js stream.Readable support from fileTypeFromStream() and fileTypeStream()
ReadableStream. Migrate with Readable.toWeb():// 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 from file-type directly.
The ReadableStreamWithFileType type has been removed. Use AnyWebReadableByteStreamWithFileType instead.
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).
.key (Keynote), .pages (Pages), .numbers (Numbers)Harden parser more aec20a0 v21.3.3...v21.3.4
Harden parser c48c90b 135f91b v21.3.2...v21.3.3
Fix ZIP bomb in known-size ZIP probing ( GHSA-j47w-4g3g-c36v ) a155cd7
Fix infinite loop in ASF parser on malformed input ( GHSA-5v7r-6r5c-r473 ) 319abf8
Add support for Mach-O Universal (aka "Fat") binaries and additional architectures ( #779 ) d223491
Add support for SPSS data files ( #787 ) 889f638
Fix handling of partial Gunzip file ( #783 ) 710e053
Add support for .tar.gz (gunzipped tarball file) (#763) eda03a7
.tar.gz (gunzipped tarball file) (#763) eda03a7.dat) (#767) f8d62behttps://github.com/sindresorhus/file-type/compare/v21.0.0...v21.1.0
Drop Adobe Illustrator (.ai) detection support (#743) af169f3
mpegOffsetTolerance option (#646) c40840ahttps://github.com/sindresorhus/file-type/compare/v20.5.0...v21.0.0
Add support Office PowerPoint 2007 (macro-enabled) slide show (#747) f1b4c7a
https://github.com/sindresorhus/file-type/compare/v20.4.1...v20.5.0
Add workaround for using bundler as the module-resolution in TypeScript (#744) 90bfe33
bundler as the module-resolution in TypeScript (#744) 90bfe33https://github.com/sindresorhus/file-type/compare/v20.4.0...v20.4.1
Add support for OpenType Font Collection (TTC) (#737) 3e576a6
https://github.com/sindresorhus/file-type/compare/v20.3.0...v20.4.0
Add node subpath export (#741) 8d39f66
node subpath export (#741) 8d39f66https://github.com/sindresorhus/file-type/compare/v20.2.0...v20.3.0
Add support for RealMedia (#740) d05d49d
https://github.com/sindresorhus/file-type/compare/v20.1.0...v20.2.0
Improve WebP detection (#733) ef486f1
https://github.com/sindresorhus/file-type/compare/v20.0.1...v20.1.0
Fix detecting small PDF file (#728) f34e9f7
https://github.com/sindresorhus/file-type/compare/v20.0.0...v20.0.1
Drop MIME-type and extension enumeration in types (#693) 0ff11c6
NodeFileTypeParser in favor of using FileTypeParser on all platforms (#707) ff8eed8FileTypeParser#detectors (#704) 7e72bbc.jar) (#719) 8651809.xltx) (#712) 0dab3e0.potx) (#710) f978619@tokenizer/inflate (#695) 399b0f1.lz4 file format (#706) 74acf94.drc, Google's Draco 3D Data Compression (#702) e99257dhttps://github.com/sindresorhus/file-type/compare/v19.6.0...v20.0.0
Add ability to abort async operations (#667) 5ce98f3
https://github.com/sindresorhus/file-type/compare/v19.5.0...v19.6.0
Add support for WebVTT (#658) 21ed763
https://github.com/sindresorhus/file-type/compare/v19.4.1...v19.5.0
Fix passing options to fileTypeStream in default entry point (#653) ea314a4
fileTypeStream in default entry point (#653) ea314a4https://github.com/sindresorhus/file-type/compare/v19.4.0...v19.4.1
Add support for web streams for fileTypeStream() (#649) 2000141
fileTypeStream() (#649) 2000141fileTypeStream() (#650) bd3b5a4https://github.com/sindresorhus/file-type/compare/v19.3.0...v19.4.0
Add support for Microsoft Visio files (#647) 2744be7
https://github.com/sindresorhus/file-type/compare/v19.2.0...v19.3.0
Add NodeFileTypeParser#fromFile() (#644) 9d2ee02
NodeFileTypeParser#fromFile() (#644) 9d2ee02https://github.com/sindresorhus/file-type/compare/v19.1.1...v19.2.0
Fix Node.js entry point export fileTypeFromTokenizer (#639) 20fdba7
fileTypeFromTokenizer (#639) 20fdba7https://github.com/sindresorhus/file-type/compare/v19.1.0...v19.1.1
Replace Buffer usage with Uint8Array (#633) 00e051bceaf0791ffc1b08b36aee196ccdd95606
https://github.com/sindresorhus/file-type/compare/v19.0.0...v19.1.0
Use mime type audio/wav instead of audio/vnd.wave for .wav files (#620) c7c923c
audio/wav instead of audio/vnd.wave for .wav files (#620) c7c923chttps://github.com/sindresorhus/file-type/compare/v18.7.0...v19.0.0
Add support for FBX (Filmbox) (#605) 4b7eb75
https://github.com/sindresorhus/file-type/compare/v18.6.0...v18.7.0
Add support for Mach-O (#615) ec4980b
https://github.com/sindresorhus/file-type/compare/v18.5.0...v18.6.0
Add support for ICC (#601) 0ccebb1
https://github.com/sindresorhus/file-type/compare/v18.4.0...v18.5.0
Add support for Avro (#597) 34ab7d4
https://github.com/sindresorhus/file-type/compare/v18.3.0...v18.4.0
Support reading from Blob in Node.js (#588) 1c75cfb
Blob in Node.js (#588) 1c75cfbhttps://github.com/sindresorhus/file-type/compare/v18.2.1...v18.3.0
Fix handling of tiny PDFs (#580) edf59f8
https://github.com/sindresorhus/file-type/compare/v18.2.0...v18.2.1
Add support for Apache Parquet (#576) 1ec164b
https://github.com/sindresorhus/file-type/compare/v18.1.0...v18.2.0
Add support for AutoDesk DWG format (#572) 47aa221
.pst) (#573) ec3ba33.jls) (#568) 976ed4bhttps://github.com/sindresorhus/file-type/compare/v18.0.0...v18.1.0
https://github.com/sindresorhus/file-type/compare/v17.1.6...v18.0.0
https://github.com/sindresorhus/file-type/compare/v17.1.6...v18.0.0
Fix an import path (#553) e843d73
https://github.com/sindresorhus/file-type/compare/v17.1.5...v17.1.6
Fix PDF detection in some cases a0c24eb
https://github.com/sindresorhus/file-type/compare/v17.1.4...v17.1.5
Fix a problem with a dependency (#549) 20a90ab
https://github.com/sindresorhus/file-type/compare/v17.1.3...v17.1.4
Fix: Malformed MKV could cause an infinite loop 2c4d120
https://github.com/sindresorhus/file-type/compare/v17.1.2...v17.1.3
Improve decoding of mime-type in ZIP file (#546) 1b10a71
https://github.com/sindresorhus/file-type/compare/v17.1.1...v17.1.2
Update dependencies (#519) 1a553e7
https://github.com/sindresorhus/file-type/compare/v17.1.0...v17.1.1
Add support for ELF (Unix Executable and Linkable Format) (#514) c4983ea
https://github.com/sindresorhus/file-type/compare/v17.0.2...v17.1.0
Prevent "Concurrent read operation" error to be thrown in some cases while reading from a stream (#510) 565f7f3
https://github.com/sindresorhus/file-type/compare/v17.0.1...v17.0.2
Update strtok3 & token-types dependencies for explicit node:buffer imports (#507) b27fb5f
strtok3 & token-types dependencies for explicit node:buffer imports (#507) b27fb5fhttps://github.com/sindresorhus/file-type/compare/v17.0.0...v17.0.1
Require Node.js 12.20 (#472) 826b4ad
/browser sub-export 287e361
require('file-type').fromBuffer → import {fileTypeFromBuffer} from 'file-type'
require('file-type').fromFile → import {fileTypeFromFile} from 'file-type'
require('file-type').fromStream → import {fileTypeFromStream} from 'file-type'
require('file-type').fromTokenizer → import {fileTypeFromTokenizer} from 'file-type'
require('file-type').stream → import {fileTypeStream} from 'file-type'
require('file-type').extensions → import {supportedExtensions} from 'file-type'
require('file-type').mimeTypes → import {supportedMimeTypes} from 'file-type'stream() (#468) 67c8fcbhttps://github.com/sindresorhus/file-type/compare/v16.5.1...v17.0.0
Fix: Malformed MKV could cause an infinite loop https://github.com/sindresorhus/file-type/commit/d86835680f4cccbee1a60628783c36700ec9e254
b5fe3b9
Fix: Malformed MKV could cause an infinite loop d868356
CVE-2022-36313
Also fixed in 17.1.3
Upgrade dependencies https://github.com/sindresorhus/file-type/commit/3b08ab1e7404dc00dfb3050d6f34821ae300b59c
Nothing published for this version
Fix mimeTypes TypeScript type (#464) 0012c56
mimeTypes TypeScript type (#464) 0012c56https://github.com/sindresorhus/file-type/compare/v16.5.0...v16.5.1
Add support for JPEG XL image format (#455) 57ecf2d
https://github.com/sindresorhus/file-type/compare/v16.4.0...v16.5.0
Add support for VCF and fix ICS detection (#451) 29618c8
https://github.com/sindresorhus/file-type/compare/v16.3.0...v16.4.0
Add support for Zstandard compressed file (#439) 9319167
https://github.com/sindresorhus/file-type/compare/v16.2.0...v16.3.0
Improve PDF / AI (Adobe Illustrator) recognition (#396) 9736aa3
https://github.com/sindresorhus/file-type/compare/v16.1.0...v16.2.0
Add support for CHM (#424) e43cdc9
https://github.com/sindresorhus/file-type/compare/v16.0.1...v16.1.0
Fix Webpack 5 compatibility (#412) eab48da
https://github.com/sindresorhus/file-type/compare/v16.0.0...v16.0.1
Your coding agent can read these notes before it upgrades. Set up the MCP server →