Detect the file type of a Buffer/Uint8Array/ArrayBuffer
MIT License
Bot releases are hidden (Show)
https://github.com/sindresorhus/file-type/compare/v14.2.0...v14.3.0
https://github.com/sindresorhus/file-type/compare/v14.1.4...v14.2.0
https://github.com/sindresorhus/file-type/compare/v14.1.3...v14.1.4
https://github.com/sindresorhus/file-type/compare/v14.1.2...v14.1.3
fromTokenizer
type definition (#331) 3432a14https://github.com/sindresorhus/file-type/compare/v14.1.1...v14.1.2
.stream()
on empty stream (#324) 659e379https://github.com/sindresorhus/file-type/compare/v14.1.0...v14.1.1
https://github.com/sindresorhus/file-type/compare/v14.0.0...v14.1.0
.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
https://github.com/sindresorhus/file-type/compare/v13.1.1...v13.1.2
.fromBuffer()
always returns a Promise (#310) 7eaf0fehttps://github.com/sindresorhus/file-type/compare/v13.1.0...v13.1.1
https://github.com/sindresorhus/file-type/compare/v13.0.3...v13.1.0
https://github.com/sindresorhus/file-type/compare/v13.0.2...v13.0.3
https://github.com/sindresorhus/file-type/compare/v13.0.1...v13.0.2
https://github.com/sindresorhus/file-type/compare/v13.0.0...v13.0.1
-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.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
.m4b
MPEG-4 audio-book detection (#256) d879ef7https://github.com/sindresorhus/file-type/compare/v12.4.1...v12.4.2
extensions
and mimeTypes
TypeScript types (#270) eff47afhttps://github.com/sindresorhus/file-type/compare/v12.4.0...v12.4.1
https://github.com/sindresorhus/file-type/compare/v12.3.1...v12.4.0
https://github.com/sindresorhus/file-type/compare/v12.3.0...v12.3.1
https://github.com/sindresorhus/file-type/compare/v12.2.0...v12.3.0