gettype

0.1.0 • Public • Published

GetType

A simple tool to get the real format of a binary file(Currently only png|jpeg|gif|bmp)

监测二进制文件的真实文件格式(目前只有常见的图片格式:png|jpeg|gif|bmp

Install 安装

npm install gettype

Usage 使用

var GetType = require( 'getType' );
var pathToParse = 'images/jpeg.jpg';

GetType.parse( pathToParse, function( err, type, mimeType ){

	if( err ){
		console.log( 'file format parse error!' );
	}
	else {
		console.log( 'file format is : ' + type, ' mime type is:' + mimeType );
	}
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    2
  • 0.0.1
    1

Package Sidebar

Install

npm i gettype

Weekly Downloads

3

Version

0.1.0

License

none

Last publish

Collaborators

  • neekey