{"name":"is-epub","version":"0.1.2","description":"Check if a Buffer/Uint8Array is EPUB","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/is-epub"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js"],"keywords":["epub","ebook","book","type","detect","check","is","binary","buffer","uint8array"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-epub/issues"},"homepage":"https://github.com/sindresorhus/is-epub","_id":"is-epub@0.1.2","dist":{"shasum":"abbb886ed11d5f5c03bc012f55afed828f727965","tarball":"http://registry-npm.ywwl.com/is-epub/download/is-epub-0.1.2.tgz","integrity":"sha512-DzZmi3wxELpsW2IY79jn2zHPDnqz7jDF/U5FE2bg/ObX8m4uyEkDihP33S2xJDxEl/XDYH9QC3uDq43y3w4P1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfiVfstMcnuQwE52nJZ0kE+B6gK9OXxl7vcBoEhb0piwIgYrak0avozP7bAQ29MxAt0bmaA8+y5ELvB6XpVys+T0U="}],"size":1138,"noattachment":false,"key":"/is-epub/-/is-epub-0.1.2.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"readme":"# is-epub\n\n> Check if a Buffer/Uint8Array is [EPUB](https://en.wikipedia.org/wiki/EPUB)\n\n## Install\n\n```\n$ npm install is-epub\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport readChunk from 'read-chunk';\nimport isEpub from 'is-epub';\n\nconst buffer = readChunk.sync('unicorn.epub', 0, 58);\n\nisEpub(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nimport isEpub from 'is-epub';\n\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.epub');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\tisEpub(new Uint8Array(this.response));\n\t//=> true\n};\n\nxhr.send();\n```\n\n## API\n\n### isEpub(buffer)\n\nAccepts a Buffer (Node.js) or Uint8Array.\n\nIt only needs the first 58 bytes.\n\n## Related\n\n- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array\n","publish_time":1398798556949,"_cnpm_publish_time":1398798556949,"dist-tags":{"latest":"2.0.0"}}