In memory mime sniffer without depencies
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
README.md
index.js
package.json

README.md

node-ee-mime-magic

In memory mime sniffer without depencies ( using the files magic numbers )

currently supporting the following file types

  • gif
  • jpeg
  • png
  • tiff
  • webp

Usage

var mimeMagic = require( "node-ee-mime-magic" );

mimeMagic( buffer, function( err, mimeType ){
	if ( err || !mimeType ) console.log( "failed to detect mime type :(" );
	else console.log( "mime type:", mimeType.mime, "extension", mimeType.extension );
} );