{"name":"is-webp","version":"1.0.0","description":"Check if a Buffer/Uint8Array is a WebP image","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-webp"},"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":"df243fb0e45900db43215dbaee10016ec11d1662","bugs":{"url":"https://github.com/sindresorhus/is-webp/issues"},"homepage":"https://github.com/sindresorhus/is-webp","_id":"is-webp@1.0.0","_shasum":"ee9bb224a06a6f0083e3dfb126e880fab4805946","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"ee9bb224a06a6f0083e3dfb126e880fab4805946","tarball":"http://registry-npm.ywwl.com/is-webp/download/is-webp-1.0.0.tgz","integrity":"sha512-8f4EQF68VEDReEy105rhS5NCV3Xa0JcAFwu/TvyfC8hFBLBkYctjRrIJhOfFobDnPDmrh1AE1f2zXQQYJ1hztg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQLUBX7E3wX8GNMDm0Keg095aFRb3JsYZSdCbDl54lqwIgHRBTwq++t5FPkY8BZcU08B9FJpNgiywbp77OwkCTw+k="}],"size":1088,"noattachment":false,"key":"/is-webp/-/is-webp-1.0.0.tgz"},"directories":{},"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":1408026751712,"_cnpm_publish_time":1408026751712,"dist-tags":{"latest":"2.0.0"}}