image type:检测BufferUint8Array的图像类型 源码
图像类型 检测Buffer / Uint8Array的图像类型 有关更多文件类型和CLI,请参见模块。 安装 $ npm install image-type 用法 Node.js const readChunk = require ( 'read-chunk' ) ; const imageType = require ( 'image-type' ) ; const buffer = readChunk . sync ( 'unicorn.png' , 0 , 12 ) ; imageType ( buffer ) ; //=> {ext: 'png', mime: 'image/png
下载地址
用户评论