{"_id":"is-webp","_rev":"901213","name":"is-webp","description":"Check if a Buffer/Uint8Array is a WebP image","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-09-18T18:30:55.000Z","created":"2014-04-21T17:40:20.681Z","2.0.0":"2021-09-18T18:26:05.138Z","1.0.1":"2018-03-22T16:30:27.923Z","1.0.0":"2014-08-14T14:32:31.712Z","0.1.1":"2014-04-29T19:15:01.693Z","0.1.0":"2014-04-21T17:40:20.681Z"},"users":{"itonyyo":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-webp.git"},"versions":{"2.0.0":{"name":"is-webp","version":"2.0.0","description":"Check if a Buffer/Uint8Array is a WebP image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-webp.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava"},"keywords":["webp","google","weppy","network","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"ava":"^3.15.0","read-chunk":"^4.0.2","xo":"^0.44.0"},"gitHead":"c5b5eff2b315c9100edec30354af06aee5797e41","bugs":{"url":"https://github.com/sindresorhus/is-webp/issues"},"homepage":"https://github.com/sindresorhus/is-webp#readme","_id":"is-webp@2.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.20.3","dist":{"shasum":"ffedde6d5d3526b1b918507df1f5d408d31f46d8","size":1769,"noattachment":false,"key":"/is-webp/-/is-webp-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-webp/download/is-webp-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-webp_2.0.0_1631989564967_0.8990052293136033"},"_hasShrinkwrap":false,"publish_time":1631989565138,"_cnpm_publish_time":1631989565138},"1.0.1":{"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":{"shasum":"2e5165cea41eb795d2348df2c31c1602bfb43896","size":1753,"noattachment":false,"key":"/is-webp/-/is-webp-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-webp/download/is-webp-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-webp_1.0.1_1521736227686_0.7985734666013078"},"_hasShrinkwrap":false,"publish_time":1521736227923,"_cnpm_publish_time":1521736227923},"1.0.0":{"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":""}],"dist":{"shasum":"ee9bb224a06a6f0083e3dfb126e880fab4805946","size":1088,"noattachment":false,"key":"/is-webp/-/is-webp-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-webp/download/is-webp-1.0.0.tgz"},"directories":{},"publish_time":1408026751712,"_cnpm_publish_time":1408026751712,"_hasShrinkwrap":false},"0.1.1":{"name":"is-webp","version":"0.1.1","description":"Check if a Buffer/Uint8Array is a WebP image","license":"MIT","repository":{"type":"git","url":"git://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","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js"],"keywords":["webp","google","weppy","network","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-webp/issues"},"homepage":"https://github.com/sindresorhus/is-webp","_id":"is-webp@0.1.1","dist":{"shasum":"1adb9cdb4a4654fef021237e49dfd8cd882a12fd","size":1151,"noattachment":false,"key":"/is-webp/-/is-webp-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-webp/download/is-webp-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398798901693,"_cnpm_publish_time":1398798901693,"_hasShrinkwrap":false},"0.1.0":{"name":"is-webp","version":"0.1.0","description":"Check if a Buffer/Uint8Array is a WebP image","license":"MIT","repository":{"type":"git","url":"git://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","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js"],"keywords":["webp","google","weppy","network","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-webp/issues"},"homepage":"https://github.com/sindresorhus/is-webp","_id":"is-webp@0.1.0","dist":{"shasum":"986166163f66e9fa1d0bc824945aa792540eefd6","size":1147,"noattachment":false,"key":"/is-webp/-/is-webp-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-webp/download/is-webp-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398102020681,"_cnpm_publish_time":1398102020681,"_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","_attachments":{},"homepage":"https://github.com/sindresorhus/is-webp#readme","bugs":{"url":"https://github.com/sindresorhus/is-webp/issues"},"license":"MIT"}