media-mime-detect
streaming detection of media-files in Node.js
This package uses stream-mmmagic to sniff for magic-bytes on a stream without interupting the
stream. In fact, this package uses stream-mmmagic
directly with a single change:
It ships with a custom magic
-file that contains patterns for mime-types that are not detected
by the current default magic
-file.
Additional file-types
video/m2pt
: MPEG2-Transport-Stream (used by cameras that record AVHCD-videos)
Installation
npm install media-mime-detect
Usage
The following example demonstrates how to use this module:
var fs = var detect =
This will generate the following output
{ type: 'image/jpeg', encoding: 'binary' }
API-reference
License
media-mime-detect
is published under the MIT-license.
See LICENSE.md for details.
Release-Notes
For release notes, see CHANGELOG.md
Contributing guidelines
See CONTRIBUTING.md.