{"name":"is-epub","version":"2.0.0","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":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"ava && xo"},"keywords":["epub","ebook","book","type","detect","check","is","binary","buffer","uint8array"],"devDependencies":{"ava":"^3.15.0","read-chunk":"^2.1.0","xo":"^0.39.1"},"gitHead":"884115c3fed067f3d45128e807216a1655790d5e","bugs":{"url":"https://github.com/sindresorhus/is-epub/issues"},"homepage":"https://github.com/sindresorhus/is-epub#readme","_id":"is-epub@2.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-jTlgtV6MwRgoR1H7vpdAAUD4N3YBBP9tRXDMX5p1W+skhgyCMIcQ/jELy1ENOWOBQD5uYeAGICamJh7LvCV+9w==","shasum":"aa64fa65ab2bdc6bad39e843101406e170fac4e0","tarball":"http://registry-npm.ywwl.com/is-epub/download/is-epub-2.0.0.tgz","fileCount":4,"unpackedSize":2808,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgj/WXCRA9TVsSAnZWagAADqUP/29IpUHjRvmvPI4q9lAN\nDjK8pIocSmjMUJOxaLtLK5Uf3hcsXrnkbwZc41QlKw6vRqbJxiO3r6P5Tbc/\nFJB8YEb5Xqr7MBILNDJ7AfuzlCRf0gCWtiZoDJFYOLaNZKyB2EFenmWX7YEL\nb0CxG73kQxUT8O8P/XjpvkhX95z5M7UVbdbjKmQ5YTUEwx7yPSdzGxes6kVe\nqpE3r3BypCJHZaWV4bb4U2xpCJMDK5CX+Q7o/ozol1SCW1Ls8ITD51bzIUQf\nezr/u4AV7LhUjMY+BhNpQNnyIviX0Zn1EBpt3jqQgoHpProA1AdCCQowFPii\nlIVNVBnASUykbLmhU0ues643mzpib5Bfc0Jdg3FhxUgRHqhbd+AiZZPhjckC\n9DiFUADRTE28MNsWp0WhqVKC8J7lHba/g9SX4A0dt/KTKFe0ZrAow2WfQrlx\nPhyaMSARd8kpKSWPBsVEkL+kwRRw/MiITQwJUJI/7L6jDP05VjHpO5WnfmAx\nRPom+LOC5mZQzlFxdPmbHt7OgIJK35ZMlYN6yuAMC8ml/UXa1duVCoQON58q\nNlvZL/eM8tDzEB/XIjs93net4ldTHRp9uZ1FTFYAy7gXTk3mnPrUarXzvrYy\nLKWlc6RAaQ6CpTat0ce24PPDK917eavb2E4diKqtZoLMUYTQTk93JMsF4o/7\nkY5I\r\n=pm1s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDqTBcZT1rWrsqbFeJD91t8e9ZGJNuXZAcq1Z8175IRIgIgSvgwa8R6nSMH7mKHnRnJRF+WnGdb2RYaSUmhlvgQPTM="}],"size":1648,"noattachment":false,"key":"/is-epub/-/is-epub-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-epub_2.0.0_1620047254759_0.2753300021124694"},"_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":1620047254900,"_cnpm_publish_time":1620047254900,"dist-tags":{"latest":"2.0.0"}}