sindresorhus/
Detect the file type of a Buffer/Uint8Array
USD raised
Recent activities
Many MP4 variants are not implemented
Support for AC3 and VOC
Question: how to detect if a file is an "alias" or a "shortcut" of a file ?
m4b audio books maps to video/mp4
Pre-POSIX.1-1988 (i.e. v7) tar header
UTF-16LE encoded text files are identified as mp3
False-positives for the `msi` detection
Support for Adobe Illustrator file ai
isSupported() method
Tests do not cover mime-type
Consider alternate (browser friendly) buffer
The v16.5.4 tag is the same as v17.1.2
Cannot import the module
Support Apache Parquet files
Dependencies are not found
.aac audio file incorrectly detected as video/mp4
Jest error while trying to use with the file-type module. How can I fix "Cannot use import statement outside a module"?
cannot use fileTypeFromBlob in next.js
Babel loader
`fixture.mp4` seems to be a `m4v`?
TIF files return an End-Of-Stream error
image/apng is not an actual MIME type
Facing an import error with webpack build
Please add JSON support
CommonJS and ESM - support both
Would it be better to return the file extension with a period?
fileTypeFromBase64
proposal: expose mime-type <-> extension relations
Readme is not updated.
build fix
JPEG files with the ".jpeg" extension are grouped under the ".jpg" category
add `application/x-compressed-tar` for `*.tgz`
Request support for FBX (Filmbox) detection
jest: Cannot use import statement outside a module
Unable to use plugin: Error [ERR_REQUIRE_ESM]: require() of ES Module
audio/mpeg detected as video/webm or video/mp4
End of stream error when checking the file type of a pdf
Cloudflare Workers support
Make `Blob` lazy
Drop `browser` export
Doesn't support and text files
Next.js, Typescript seems not work with conditional exports
strapi plugin - require() of ES Module not supported
.pdf files can be detected as .ai based on content
Detect SOF55 marker to distinguish JPEG-LS from baseline JPEG
Your repository makes the computer slow
Makes my hero run out of memory while running
NextJs Support
fileTypeFromBlob is not exported from index.js
token-types dependency update
Require of ES Module not supported
Enforce alphabetical order for supported file types list
"Concurrent read operation" error thrown reading from stream
I can't load through commonjs in Node
file-type does not work in browsers
How do I bundle file-type for web browsers?
TypeSCript error "Must use import to load ES Module"
node: prefix error using in browser
SyntaxError: Cannot use import statement outside a module
README is faulty
FileType.fromFile htm/html file returns undefined !
Error when trying to import/use in svelte/rollup project.
Cannot find module 'strtok3/core' from 'node_modules/file-type/core.js'
Is there any good ideas to detect html,svg,txt,js,css?
Problem with upload file / triggerUncaughtException
.doc file detected as application/x-cfb
Either make this package browser capable or declare it pure node
Unable to get file-type to run in browser (modules strtok3/core and token-types not found)
How to check mime type of url without downloading the file?
Cannot find module 'strtok3/core'
Cannot find module 'node:stream' or its corresponding type declarations
Issue with checking epub mimetype
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module
Babel transpilation error
node 12 fresh install unexpected token
PDF Files cause `fromStream` to never finish
PDF is not detected correctly if it starts with a UTF-8 BOM byte sequence
Allowed return type for custom detectors are to narrow
PDF detection fails on uncaught Adobe AI check error on very small files
NextJS - cannot import fileTypeFromFile
Missing fileTypeOptions for `fileTypeFromStream` function in index declaration file
Test resulting mime against those in supported.js ?
Consider adding `opendocument` and `officedocument` templates mime ?
Error after error in nodejs 23.4.0: [TypeError: (intermediate value).get(...).replace is not a function]
Cannot read properties of undefined (reading 'call') in react
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in \node_modules\file-type\package.json
The requested module 'peek-readable' does not provide an export named 'WebStreamReader'
fileTypeFromBlob throws an exception on Mac
Detecting a pptx taking a very long time
Detect animated image
Time Complexity of Detecting Image File Type
cannot use method fileTypeFromStream in aws lambda typescript handler
Support for .xlsm, .ppsm, .ppsx, .vsdx, .docm file types
`fileTypeFromStream` throws an error in combination with strtok3@9.0.1
False negative on some MP3s
Detecting gz files hangs forever
PDF detection can be bypassed by adding a fake header
`fileTypeStream` does not detect docx files
Xml detected but Svg is not supported
ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
Encoding missing in tarHeaderChecksumMatches fn
(feat): Provide enumeration types for ext and mime of FileTypeResult
Current tar file detection is unreliable
Chromium consistently crash after processing ~990 files (of several specific types) with `fileTypeFromBlob` - a.readFromStream WebStreamReader.js - TypeError: network error
not support .wps?
Support for ppsx
file-type package PNG detection issue
PDF not recognized
fileTypeFromFile not found
Cannot determine file type from tee'd ReadableStream until both branches complete
Move WebP check to the RIFF checks to reduce potential false-positives
FileType returns undefined on pdf file
Why does file-type's `fileTypeFromBuffer` return different outputs for SVG files?
Hang
Custom detectors running after default detectors
CommonJS / Hybrid Package
Add support for .eml aka message/rfc822
The requested module '/node_modules/.vite/deps/file-type.js?v=74b3d8f6' does not provide an export named 'fileTypeFromBlob'
Detect NEF format, the result is image/tiff
`SyntaxError: Cannot use import statement outside a module` When running in Jest
blob.arrayBuffer is not a function
mimetype of certain PNGs mislabeled as "text/plan"
Uncaught SyntaxError: The requested module does not provide an export named 'fileTypeFromBlob' in browser
Filetype return undefined with .npy file
Support reading from browser streams in server-side export
When I download `file-type` into the webpack 3 project, running the error message requires installation `strtok3`
Got this build error: Could not resolve "node:buffer"
Password-protected `xlsx` files detected as `cfb`
fileTypeStream broken import
Changes on typing break with `stream.Readable`
Incorrect MIME type for Opus files.
file-type ERR_PACKAGE_PATH_NOT_EXPORTED typescript
Support for WebVTT files (text/vtt)
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined
No "exports" main defined
Maybe file-type should mention the runtime require full icu-data
Can't access node functions when tsconfig moduleResolution is set to "bundler"
[ERR_REQUIRE_ESM] Error using webpack or babel
Cannot find name 'ReadableStream' when compiling project with file-type dependency
Automate generation of the release notes
fileTypeFromFile are not defined in browser.d.ts
TypeError when upgrading from 19.0.0 to 19.1.0: "ReadableStreamBYOBReader needs a ReadableByteStreamController"
19.1.0 does not export `fileTypeFromTokenizer`
Add detecting Web Stream support
Add support for ES module "require" syntax
Very small file (11 byte)
Tar detection seems broken
Possible to use file-type as a transform stream in a pipeline()?
Please add this xls-test
Excel (.xls) files detected as application/x-msi
Expected identifier, string or number in the Edge browser
Returns End-Of-Stream Error while Uploading .zip file
Is mp4 really an image/mp4 mime type not something like audio/mp4 or video/mp4?
m4a from android phone recognizes as 'video/mp4', but should 'audio/x-m4a'
stream does not work with simple got stream snippet
Browser compatibility questions
Extending file-type
Word files (.docx) identified as application/zip
Support PGP
Please check csv
TypeScript definition error
stream.unshift() after end event
minimumBytes was not properly deprecated, breaking change
PNG with long iTXt chunk not detected as PNG image
docx
make minimumBytes = 4100 public
fromTokenizer error: Offset hasn't been loaded yet.
Document expected return values of unsupported file types
.txt detection broken.
Add `asar` support
Doesn't work with Node v13.3.0?
Not running in browser (uses node's Buffer)
Mime type : text/csv is not supported by fileType.fromBuffer() method
index.js in published package only has fromFile
Mime type not being detected using fromStream, despite buffer matching the magic number
text/html
FileType.fromBlob and fs.stat() is not a function
return undefined for file.py or file.php
Possible bug: Stream gets mangled after passing through FileType.fromStream
PDF created with Adobe Illustrator are wrongly detected as .ai files
Can't make it work in a browser
Returns undefined for ICNS files
fileType undefined when using stream
Possible flaw in .pptx detection
Failes to detect MP4 (.m4b) audiobook
Support for tracked/module file formats
MOV Fixture CVE-2009-1539
ARW files report as TIF
Change proposal: break the fixed sample limit
Improve the MPEG/ADTS frame / ID3 detection algorithm
Add Esri Shapefile support?
.aac is detected as .mp4 (audio/mpeg)
Can't compile build because of spread operator
Check archive types before any other type
Add tests for `.asf`, `.ogm`, `.ogx`, and `.mpc` file types
SyntaxError: Unexpected token ...
Add tests to ensure all the data is in sync
Not working in IE
'SCRIPT1010: Expected identifier' on IE11
100% cpu with 177.3 MiB zip
ASF/.asf detection is missing / broken
End-Of-Stream error thrown parsing docx
Docx files being detected as a zip
FileType.fromBuffer() returns undefined instead of a promise
inconsistent behavior for small size buffer
Cant't resolve fs after updating to 13.0.3 version
.sub file is detected as video/mpeg
why not to support doc, xls, ppt?
`import fileType from "file-type/browser"` can not be used in in 13.0.0
more format need to be added
Update tokenizer example in README to @tokenizer/http v0.5.0
Pixelation on specific channels
Ability to detect .mka (Matroska audio)
Ability to detect audio WebM
TypeError: Expected the `input` argument to be of type `Uint8Array` or `Buffer` or `ArrayBuffer`, got `object`
Detect audio files with an ID3 header, which are not MP3
add .csv type support
xo breaks Windows compatibility in development
vcard are considered as a ics calendar
Asking for subcategory of MS-CFB
TypeError: stream.getReader is not a function
Use new blob read methods
Support htmlFile
missing main field in package.json
unshift stream support
possibly support xcf?
Can file-type recognize text/xml mime type?
EOT not detected
MPEG sync check at odd offset required?
Support: lz4 and avro file-types
Zip File Type Determination Slow When Using fromTokenizer Method
Issue Detecting PNG
Block Stream Pipe
Support DWG File
Edge Legacy (44): Expected identifier, string or number
Read blob in nodejs
React Native Error
Undefined fileTypeFromBlob in browser?
Keep CommonJS API function names
XML Filetype parsing fails with bom character
audio/webm detected as video/webm
Type detection fails for JPG file
Type detection failing for webm format file
Docs are off with what users get from NPM
Allow disabling unsafe types?
Support JSON
DNG is falsely detected as TIFF
Support for text based file formats
Detect via JS native in browser
v16.5 patch release with unlocked dependency versions `strtok3` & `token-types`
Code examples provided in typing definition files have syntax errors
`stream()` does not like the stream from module `got`
Updated dependency strtok3 v6.2 will break file-type
`stream()` may throw End-Of-Stream error
Facing issue while validating a .txt/.js file in ubuntu
Getting undefined file type for buffer
Why is detecting file type from buffer async?
Question: User file-type check on frontend
ERROR in ./node_modules/readable-web-to-node-stream/lib/index.js Module not found
Why '.svg' is not typeof '' instead of 'application/xml'
Asar support breaks on asar archives where JSON header size >= 240
Add .txt file type support
file-type throws an "unexpected error" in Internet Explorer
*.docm was detected was *.docx
Add .stl file type support?
WMV video file mistakenly identified as audio
One doubt, the file types .txt, .csv are returned as undefined. Can we consider as which all files like csv txt which are having plain text no magic number or header to find MIME type for those the result would be undefined?
file type of .xlsx is coming as application/x-msi
it is saying undefined for .txt type is it the same case as .csv?
Corrupt PNG file (invalid chunk length) causes read error
FileType.{extensions,mimeTypes} is undefined in browser build
False positives test are broken
Don't support elf file?
Application is not loading in IE after installing file-type
Support compressed ISO image
Support Windows Event Viewer file
Support ICC profile
Support Windows Registry file
Support Personal Storage Table file
Support 3D model compressed with Google Draco
fromBuffer and stream methods give different results for same ai file
Not recognising `application/pdf` file types
Support Microsoft Compiled HTML Help
Support for Estonian digital-signed documents
Uncaught SyntaxError: Unexpected token ...
Failing to compile in typescript project
No file type retrieved when reading from Buffer
Error while building with webpack
How to use it with Browser
Module not found: Error: Can't resolve 'fs' in '..../node_modules/strtok3/lib'
© 2019 BoostIO, Inc.