file-type
file-type copied to clipboard
Detect the file type of a Buffer/Uint8Array/ArrayBuffer
First, thanks so much for this package! We've been using it at work to validate files uploaded by users and it works as expected for the majority of our use...
Allow 4 bytes of prefixing MPEG noise. Via `options.mpegOffsetTollerance` this number can be increased, which will result it a bit slow scanning times. Resolves #628 ToDo - [ ] Document...
I'm using tsup to bundle my node project into a single file, and have `moduleResolution: "bundler"` set in my tsconfig because a) it feels like the right choice as I'm...
Presumably resolves #624 Some of the difference are caused by bytes being swapped, which looks like differences in [endianness](https://en.wikipedia.org/wiki/Endianness).
### Description Currently, the `ext` and `mime` attributes of `FileTypeResult` only have the string type If provided: ``` ts enum ExtTypes = { png, jpg, ... } ``` or ```...
MIME media subtypes prefixed with `x-ft-` are custom-defined by us. They are neither formally registered with IANA nor based on any informal conventions. These MIME-type mappings changed: - `application/x-lzip` ↦...
WebM audio file detected as: ```js { ext: 'webm', mime: 'video/webm' } ``` expected: ```js { ext: 'webm', mime: 'audio/webm' } ``` Sample file: [02 - Poxfil - Solid Ground...