package
A simple tool to get the real format of a binary file
npm install gettypeGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
##GetType
A simple tool to get the real format of a binary file(Currently only png|jpeg|gif|bmp)
监测二进制文件的真实文件格式(目前只有常见的图片格式:png|jpeg|gif|bmp)
###Install 安装
###Usage 使用
var GetType = require( 'getType' );
var pathToParse = 'images/jpeg.jpg';
GetType.parse( pathToParse, function( err, type ){
if( err ){
console.log( 'file format parse error!' );
}
else {
console.log( 'file format is : ' + type );
}
});Estimated unpacked size across 13 packages.
4.9 MB
Includes dependencies.