{"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":{"integrity":"sha512-IHKBowSO+VNk82mKN5EOocEd97Q7tFDqupVhHZOsp/mKEB+ZO5BtmVfbXh0cH//QOsF1ldioXSj4E+QHrEY64g==","shasum":"ffedde6d5d3526b1b918507df1f5d408d31f46d8","tarball":"http://registry-npm.ywwl.com/is-webp/download/is-webp-2.0.0.tgz","fileCount":4,"unpackedSize":3058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2wG2CRA9TVsSAnZWagAAsY0QAISI0zprVUQN0mx6WD08\ntpn1ltFeIQwHHwU9fy4JDvRxi1QaUdLj/sPnuU5v27t3alhpHvh99/c4Xf8O\n7UuIQzLBXudKmHpOehcE4q2lkOvlx8HYNe0utsDbpKzpcY7iDIuBex1NpL/z\nChtWjvKq9BYMvYA/0P6WOY2LyRyvWa0RdNm+XrMG6VcLDr8lLnfmjNZhYAZj\nAMuybWQW9eM0TYTJA8N/af1REf+tWTCtNbYq5lhetII/IU4Sa0W0w6TKEEPb\n7XyqGrKOhx8x9bn4Wa4/9Vkt6WY9drABCyWuD7nD0xgu9/RDV7t3q1qxeYzT\nmfisPyUhKE8GrQbAwioYe3d/RVU2VT4nURENWNsFFyDf+LpFA7M7xjQS4k4v\nUveR9w3DO2/C96Fve9lZ2ph/fnQ3JRw6UmtiEl+ckgmk0u5kYFL/SGTp1vpk\nzjf7ns3s/pPvePZyLLQTq17lvUdQWwAVGNPf2bN0UBXSU3I5sSlJUFo2iZK7\n+1zAPFPBORJ/XoAW4c4VmDWk3NcO6d/xKuKqUwm0Cg3nGPDBHB7CT/XgZuy6\nRL7VNW1PVjx3Mer8s7Mb/1yyO+hg7j8f4N2hPjgbW2Oc2hi4votKQAbrENqS\niQpOODcww0S9AN3GSsQgYOmwW9feQBphQouEuSH3S4HcQfFaNJRVYnEkxAYN\n2l/E\r\n=nM5e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCwBJ+40j3Lb9m8iUPQJ4PHNfczNgJ1cENBeJB78ygYwIhAIjXZyFyKxUDu7s1zpleD+lFuGs+EXPEQ4Hkh4Wi1+Jo"}],"size":1769,"noattachment":false,"key":"/is-webp/-/is-webp-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-webp_2.0.0_1631989564967_0.8990052293136033"},"_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":1631989565138,"_cnpm_publish_time":1631989565138,"dist-tags":{"latest":"2.0.0"}}