{"name":"is-epub","version":"1.0.0","description":"Check if a Buffer/Uint8Array is EPUB","license":"MIT","repository":{"type":"git","url":"https://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"},"files":["index.js"],"keywords":["epub","ebook","book","type","detect","check","is","binary","buffer","uint8array"],"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"cf7fdd2921023eefa465f80eca3972bb22ef7be9","bugs":{"url":"https://github.com/sindresorhus/is-epub/issues"},"homepage":"https://github.com/sindresorhus/is-epub","_id":"is-epub@1.0.0","_shasum":"c33159588fe35297008e8fbaa1e8be6a46a86a51","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"c33159588fe35297008e8fbaa1e8be6a46a86a51","tarball":"http://registry-npm.ywwl.com/is-epub/download/is-epub-1.0.0.tgz","integrity":"sha512-hFMXoORoJW+biSsj6V5rvl64AeZWXn9+bDvGDSqGNl6tpJiNmz670TG32fyL9GPAyD3WgZfZNEhfoaSEOzkjwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOEoFD1Ovs4bOTzEwTtPQ+Ut+fxmF7v5iXxWbS3mHZSgIhAJ1FWktFwZS2TGqcbn3riGdaWgJTiBE8ZDOke9ObbYKu"}],"size":1075,"noattachment":false,"key":"/is-epub/-/is-epub-1.0.0.tgz"},"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":1408035633516,"_cnpm_publish_time":1408035633516,"dist-tags":{"latest":"2.0.0"}}