{"name":"is-epub","version":"1.0.1","description":"Check if a Buffer/Uint8Array is EPUB","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-epub.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["epub","ebook","book","type","detect","check","is","binary","buffer","uint8array"],"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"e7b566655147ed8564197a9b854deeace0b1eaaf","bugs":{"url":"https://github.com/sindresorhus/is-epub/issues"},"homepage":"https://github.com/sindresorhus/is-epub#readme","_id":"is-epub@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-FBWuwBR74DX2Oq4TtW4IoDbaBI4dShMqrsmxanH0Xf9+MvW8GJaRoWKyDQ5NrQqqjddM7YPe/dE3vlPI8F1eGw==","shasum":"eaad390b9a354242372d916ad2eaaa8aaaa6cb2c","tarball":"http://registry-npm.ywwl.com/is-epub/download/is-epub-1.0.1.tgz","fileCount":4,"unpackedSize":2923,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT4rf2TMLcaQBbTeBXOx3VSuaPWQ6Ugyvnwc+v7/zqYQIhAP2+9BfOYsaRG/vyG7zTopZ0y/crgWoz5TXD5y9CD/q4"}],"size":1734,"noattachment":false,"key":"/is-epub/-/is-epub-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-epub_1.0.1_1521736765339_0.632869077374659"},"_hasShrinkwrap":false,"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":1521736765591,"_cnpm_publish_time":1521736765591,"dist-tags":{"latest":"2.0.0"}}