Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

21 lines (15 sloc) 0.467 kb

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 );
} );
Jump to Line
Something went wrong with that request. Please try again.