{"name":"is-webp","version":"1.0.1","description":"Check if a Buffer/Uint8Array is a WebP image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-webp.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":["webp","google","weppy","network","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"79a955edea7b7763b9e7bea3071996627645491b","bugs":{"url":"https://github.com/sindresorhus/is-webp/issues"},"homepage":"https://github.com/sindresorhus/is-webp#readme","_id":"is-webp@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-yWlD81yjeMLEloQjM5USNA31Slcabi1tZupHAobQkfHTvWwYsZiu0VFTFUqeCbMDTB/Lb14LYjwAClJABZnuMA==","shasum":"2e5165cea41eb795d2348df2c31c1602bfb43896","tarball":"http://registry-npm.ywwl.com/is-webp/download/is-webp-1.0.1.tgz","fileCount":4,"unpackedSize":2990,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC07Kf74f6DF1R49NWxguqRkoCP0v7PIZv16wzxs+NpXAiBS2nuYU6zP1H/Yt7nw01lCuE4I+KTDMYkV/BQMxWabOw=="}],"size":1753,"noattachment":false,"key":"/is-webp/-/is-webp-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-webp_1.0.1_1521736227686_0.7985734666013078"},"_hasShrinkwrap":false,"readme":"# is-webp\n\n> Check if a Buffer/Uint8Array is a [WebP](https://en.wikipedia.org/wiki/WebP) image\n\n## Install\n\n```sh\nnpm install is-webp\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunk} from 'read-chunk';\nimport isWebp from 'is-webp';\n\nconst buffer = await readChunk('unicorn.webp', {length: 12});\n\nisWebp(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.webp');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\tisWebp(new Uint8Array(this.response));\n\t//=> true\n};\n\nxhr.send();\n```\n\n## API\n\n### isWebp(buffer)\n\nAccepts a `Buffer` (Node.js) or `Uint8Array`.\n\nIt only needs the first 12 bytes.\n\n## Related\n\n- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array\n- [is-webp-extended](https://github.com/mooyoul/is-webp-extended) - Extended version of this package which supports checking for animated WebP\n","publish_time":1521736227923,"_cnpm_publish_time":1521736227923,"dist-tags":{"latest":"2.0.0"}}