mime-sniffer
A little utility to get the mime-type from binary files.
Unlike mime, mime-sniffer uses magic numbers instead of file extensions to get a more accurate (and less easily faked) mime-type for a given file.
Install
npm install mime-sniffer --save
Usage
var mime = ;mime;
You can also pass in a Buffer:
var fs = ;var mime = ;mime;
Supported files
To see what file types are supported, take a peek in the lib/numbers.js
file.
Currently, mime-sniffer supports:
Images
- gif
- png
- jpg
- webp
- tiff
- bmp
Video
- mp4
- mov
- webm
Audio
- mp3
- ogg
- flac
- wav
Misc
License
MIT