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 16 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
Replace .wma / .wmv with .asf detection (the container format) (#398) fe331be
https://github.com/sindresorhus/file-type/compare/v15.0.1...v16.0.0
Prevent detecting corrupt PNG file (#392) ec88386
https://github.com/sindresorhus/file-type/compare/v15.0.0...v15.0.1
One column per quarter.
Replace MSI detection with Microsoft CFB (#388) 5de41fd
https://github.com/sindresorhus/file-type/compare/v14.7.1...v15.0.0
Fix tar detection (#385) 3effaee
tar detection (#385) 3effaeehttps://github.com/sindresorhus/file-type/compare/v14.7.0...v14.7.1
Fix the .extensions TypeScript type (#380) a58081c
.extensions TypeScript type (#380) a58081chttps://github.com/sindresorhus/file-type/compare/v14.6.2...v14.7.0
Fix error when using FileType.fromStream() on small files (#370) 50eee35
FileType.fromStream() on small files (#370) 50eee35https://github.com/sindresorhus/file-type/compare/v14.6.1...v14.6.2
Fix ZIP header detection for MS Office files (#369) 402fb0b
https://github.com/sindresorhus/file-type/compare/v14.6.0...v14.6.1
Add support for PGP (#367) 4a851af
https://github.com/sindresorhus/file-type/compare/v14.5.0...v14.6.0
Add support for LZH (#361) 352c05b
https://github.com/sindresorhus/file-type/compare/v14.4.0...v14.5.0
Add support for ICNS (#356) 6ec2897
https://github.com/sindresorhus/file-type/compare/v14.3.0...v14.4.0
Add support for Encapsulated PostScript (EPS) (#353) 070c4c1
https://github.com/sindresorhus/file-type/compare/v14.2.0...v14.3.0
Add support for SKP (#351) 30e8354
https://github.com/sindresorhus/file-type/compare/v14.1.4...v14.2.0
Support current-generation Nikon D750 NEF (#337) https://github.com/sindresorhus/file-type/commit/32590a95944477477fafba075c22155899aa3b90
https://github.com/sindresorhus/file-type/compare/v14.1.3...v14.1.4
Fix bug for short streams where stream ends on first read (#334) 90a213d
https://github.com/sindresorhus/file-type/compare/v14.1.2...v14.1.3
Fix missing fromTokenizer type definition (#331) 3432a14
fromTokenizer type definition (#331) 3432a14https://github.com/sindresorhus/file-type/compare/v14.1.1...v14.1.2
Prevent throwing error in .stream() on empty stream (#324) 659e379
.stream() on empty stream (#324) 659e379https://github.com/sindresorhus/file-type/compare/v14.1.0...v14.1.1
Add support for MPEG program stream (#322) 383a831
https://github.com/sindresorhus/file-type/compare/v14.0.0...v14.1.0
Removed .minimumBytes (#319) c4966b8
.minimumBytes (#319) c4966b8
FileType.minimumBytes became obsolete since we now read beyond this 4k boundary. Use . fromFile() for efficient detection.strtok3 dependency (#318) 4616640
FileType.fromTokenizer(tokenizer), see https://github.com/sindresorhus/file-type/pull/318#issuecomment-578476746.iTXt chunk (#321) a59869bhttps://github.com/sindresorhus/file-type/compare/v13.1.2...v14.0.0
Detect Office 365 documents: docx, pptx, xlsx (#317) 8f70d9c
https://github.com/sindresorhus/file-type/compare/v13.1.1...v13.1.2
Prevent size related exceptions (#307) 936b020
.fromBuffer() always returns a Promise (#310) 7eaf0fehttps://github.com/sindresorhus/file-type/compare/v13.1.0...v13.1.1
Add audio module detections: .it, .s3m & .xm (#305) b824802
https://github.com/sindresorhus/file-type/compare/v13.0.3...v13.1.0
Restore Node.js 8 compatibility 09eec7b
https://github.com/sindresorhus/file-type/compare/v13.0.2...v13.0.3
TypeScript type fixes e209647 2c86443 32b2948
https://github.com/sindresorhus/file-type/compare/v13.0.1...v13.0.2
Fix TypeScript types for the browser sub-module fb15b12 2ed0d92
https://github.com/sindresorhus/file-type/compare/v13.0.0...v13.0.1
Rewrite the API and make it async (#286) 8f981c3
-const fileType = require('file-type');
+const FileType = require('file-type');
-console.log(fileType(buffer));
+console.log(await FileType.fromBuffer(buffer));
-const fileType = require('file-type');
+const fileType = require('file-type/browser');
.fromFile() method to detect the file type of a file (#286) 8f981c3.fromStream() method to detect the file type of a stream (#286) 8f981c3
If you have access to the file, this method is recommended over .fromBuffer(), as it can better optimize the detection speed..fromBlob() convenience method when used in the browser (#286) 8f981c3CR3 (#292) 204599aFileType.stream() error (#273) 3840e6ahttps://github.com/sindresorhus/file-type/compare/v12.4.2...v13.0.0
Fix .m4b MPEG-4 audio-book detection (#256) d879ef7
.m4b MPEG-4 audio-book detection (#256) d879ef7https://github.com/sindresorhus/file-type/compare/v12.4.1...v12.4.2
Fix extensions and mimeTypes TypeScript types (#270) eff47af
extensions and mimeTypes TypeScript types (#270) eff47afhttps://github.com/sindresorhus/file-type/compare/v12.4.0...v12.4.1
Add support for Apache Arrow (#253) 9767ad1
https://github.com/sindresorhus/file-type/compare/v12.3.1...v12.4.0
Fix false-positive in ARW detection (#251) f379c5b
https://github.com/sindresorhus/file-type/compare/v12.3.0...v12.3.1
Add support for MIE (#239) b85fe96
https://github.com/sindresorhus/file-type/compare/v12.2.0...v12.3.0
Add fileType.extensions and fileType.mimeTypes properties, so you can check what extension/mime-types this package supports (#229) bca081b
fileType.extensions and fileType.mimeTypes properties, so you can check what extension/mime-types this package supports (#229) bca081bBuffer usage optional again (for improved browser support) (#232) dc611b4msi false-positives (#225) 702f795https://github.com/sindresorhus/file-type/compare/v12.1.0...v12.2.0
Improve performance of the ZIP check (#227) 43d3cd6
https://github.com/sindresorhus/file-type/compare/v12.0.1...v12.1.0
Reject on stream error events (#224) a1da90b
https://github.com/sindresorhus/file-type/compare/v12.0.0...v12.0.1
Add support for APNG (#215) 17e9c5f
Breaking:
Enhancements:
https://github.com/sindresorhus/file-type/compare/v11.1.0...v12.0.0
Add support for orf, arw, dng, and nef RAW image types (#213) 6c3df3e
Enhancements:
Fixes:
https://github.com/sindresorhus/file-type/compare/v11.0.0...v11.1.0
Return undefined instead of null when there's no match 1359ccc
Breaking:
undefined instead of null when there's no match 1359cccimport fileType from 'file-type'; to import fileType = require('file-type');Enhancements:
ac3 and voc formats (#201) 7038abclnk and alias formats (#200) aacd31atar (#204) fc9f973Fixes:
mp2/mp3 checks to not catch mp1 (#205) 44b3c34https://github.com/sindresorhus/file-type/compare/v10.11.0...v11.0.0
Allow ArrayBuffer as input (#193) b714ddd
ArrayBuffer as input (#193) b714dddfileType.stream method (#195) 7bbbacchttps://github.com/sindresorhus/file-type/compare/v10.10.0...v10.11.0
Refactor TypeScript definition to CommonJS compatible export (#194) d4ee6db
https://github.com/sindresorhus/file-type/compare/v10.9.0...v10.10.0
Add TypeScript definition (#188) e5f58a9
.stream() method (Node.js-only) (#187) 4fb22b3https://github.com/sindresorhus/file-type/compare/v10.8.0...v10.9.0
Add support for Libpcap File Format (#185) 2c77d78
https://github.com/sindresorhus/file-type/compare/v10.7.1...v10.8.0
Remove incorrect byte from aiff check (#183) 49dfa1d
aiff check (#183) 49dfa1dAdd support for GLB (#179) 516084f
Add support for iCalendar (#173) d9186c9
Add support for Musepack SV7 & Musepack SV8 (#176) 70bceda
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This release adds support for wma. It's a major release as it makes the wmv check more strict as a side-effect. https://github.com/sindresorhus/file-t
This release adds support for wma. It's a major release as it makes the wmv check more strict as a side-effect. https://github.com/sindresorhus/file-type/commit/a1692fc706e13d03aedf61adb6de40dd518f2862
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →