is-png:检查BufferUint8Array是否为PNG图像

时间:2021-04-29 07:38:22
【文件属性】:
文件名称:is-png:检查BufferUint8Array是否为PNG图像
文件大小:104KB
文件格式:ZIP
更新时间:2021-04-29 07:38:22
JavaScript is-png 检查Buffer / Uint8Array是否为图像 安装 $ npm install is-png 用法 Node.js import readChunk from 'read-chunk' ; // npm install read-chunk import isPng from 'is-png' ; const buffer = readChunk . sync ( 'unicorn.png' , 0 , 8 ) ; isPng ( buffer ) ; //=> true 浏览器 import isPng from 'is-png' ; const response = await fetch ( 'unicorn.png' ) ; const buffer = await response . arrayBuffer ( ) ; isPng ( new Uint
【文件预览】:
is-png-main
----fixture.png(53KB)
----.gitignore(23B)
----fixture.jpg(58KB)
----.github()
--------workflows()
----.gitattributes(19B)
----package.json(842B)
----index.test-d.ts(307B)
----readme.md(871B)
----index.js(302B)
----index.d.ts(654B)
----test.js(246B)
----.editorconfig(175B)
----license(1KB)
----.npmrc(19B)

网友评论