【文件属性】:
文件名称:is-epub:检查BufferUint8Array是否为EPUB
文件大小:202KB
文件格式:ZIP
更新时间:2021-05-12 09:37:34
JavaScript
伊斯普
检查Buffer / Uint8Array是否为
安装
$ npm install is-epub
用法
Node.js
import readChunk from 'read-chunk' ;
import isEpub from 'is-epub' ;
const buffer = readChunk . sync ( 'unicorn.epub' , 0 , 58 ) ;
isEpub ( buffer ) ;
//=> true
浏览器
import isEpub from 'is-epub' ;
const xhr = new XMLHttpRequest ( ) ;
xhr . open ( 'GET' , 'unicorn.epub' ) ;
xhr . responseType = 'arraybuffer' ;
xhr . onload = ( ) => {
【文件预览】:
is-epub-main
----.gitattributes(19B)
----.github()
--------workflows()
----test.js(238B)
----fixture.epub(200KB)
----license(1KB)
----.npmrc(19B)
----.editorconfig(175B)
----.gitignore(23B)
----index.js(263B)
----readme.md(784B)
----package.json(644B)