Download Latest Version v22.0.1 source code.zip (68.8 MB)
Email in envelope

Get an email when there's a new version of File-Type

Home / v22.0.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-03-26 1.7 kB
v22.0.0 source code.tar.gz 2026-03-26 68.7 MB
v22.0.0 source code.zip 2026-03-26 68.8 MB
Totals: 3 Items   137.5 MB 0

Breaking

  • Requires Node.js 22
  • Dropped Node.js stream.Readable support from fileTypeFromStream() and fileTypeStream()
  • These now only accept a web ReadableStream. Migrate with Readable.toWeb() (nodejs.org): ```js // 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).

Improvements

  • Added detection for Apple iWork files: .key (Keynote), .pages (Pages), .numbers (Numbers)

Fixes

  • Fixed LibreOffice OOXML files being incorrectly detected as ZIP when reading from streams

https://github.com/sindresorhus/file-type/compare/v21.3.4...v22.0.0

Source: README.md, updated 2026-03-26