{"name":"is-jxr","version":"2.0.0","description":"Check if a Buffer/Uint8Array is a JPEG XR image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-jxr.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":["jxr","jpeg xr","jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"devDependencies":{"ava":"^3.15.0","read-chunk":"^4.0.2","xo":"^0.44.0"},"gitHead":"c8efc51c35353d69f6935b13de9fc6afec1e06e0","bugs":{"url":"https://github.com/sindresorhus/is-jxr/issues"},"homepage":"https://github.com/sindresorhus/is-jxr#readme","_id":"is-jxr@2.0.0","_nodeVersion":"16.9.1","_npmVersion":"7.20.3","dist":{"integrity":"sha512-qi9Ln2j9RVQ2N6HgFjQ5oJW7/3DCWSl4LaUZ4DkIBt/i7mzf77xOpKkJDtV/Na9vC/j2FxfZcNotgX7YqVilbQ==","shasum":"fc7365186cbb126977469febe1d06a3a377cbb22","tarball":"http://registry-npm.ywwl.com/is-jxr/download/is-jxr-2.0.0.tgz","fileCount":4,"unpackedSize":2885,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2wFBCRA9TVsSAnZWagAAiocQAJjwOujc5AFGpPT+rlEF\nxmK9hl9vPYx7s2ewUeTAu19G9orysAVxfS8KmABcFD5Hi0QCHNWvtJBo6yp/\nj95xt1I4fItzjYS0cXLs5hYIKKK6xYre5YPmS3U2qzqfCjOu2nnjyR1Iw6dm\nr4r3vw3ro+KUluj8WKMFuAG19hs35R7q0AD25hXvtpTiB5BgZDkIaivBLfO/\n4LBQ+2kMx0oaZI+6lUEPAwLEZOCZNYPW4qXMsO1VWyIV1USWEw1XOk+6Y1ri\nWmQezKTy5hvsI6WuwH6aBPG1uoaJU9X/weY20eLZzA9PoC8rB+eO5wEYi0h4\nJO5bEPP74lJ+dQH8wLaz22G21K+EYEdpiuP97qPbpmz3DjAjTfUnCIa70l3Y\nPwqBcALAJsKW6jEn5BWaVHh7E6QDCuAXaXkvsDfoaypoHQPgUAhREDtohWlB\nfkZ/nV4B8grMpgjj1BAiatWcn8C7s59KXC0q0rVdAeqj5ep+dg0OR1FHmbmu\ngP4X7aaFXSBrZf9jmDvuwZszYvooutB/VOv4TPDL60k8ufGkVoOzQ8TbXE78\n5gBTXZShdtktKfWoAGE4ajInR01mQ2+c3OHyo/epeliuKHK6XQmgeUrqWmZK\nJzaWnHzObonmQ9S9VI0W1htEXmluNLHe29/motK22u6BE4Y+BhnrrVsB9iaq\nHgem\r\n=CybW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC+uzigBq3iMpcXCR7Ta9OkRmPP/m+sCXLzALMklF6IbAiAxYJWEQbUeY9lVNsn5vFD3CIjcz5zIFY/JXEun4G3BAg=="}],"size":1698,"noattachment":false,"key":"/is-jxr/-/is-jxr-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-jxr_2.0.0_1631990801230_0.608836149874237"},"_hasShrinkwrap":false,"readme":"# is-jxr\n\n> Check if a Buffer/Uint8Array is a [JPEG XR](https://en.wikipedia.org/wiki/JPEG_XR) image\n\n## Install\n\n```sh\nnpm install is-jxr\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunk} from 'read-chunk';\nimport isJxr from 'is-jxr';\n\nconst buffer = await readChunk('unicorn.jxr', {length: 3});\n\nisJxr(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.jxr');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\tisJxr(new Uint8Array(this.response));\n\t//=> true\n};\n\nxhr.send();\n```\n\n## API\n\n### isJxr(buffer)\n\nAccepts a `Buffer` (Node.js) or `Uint8Array`.\n\nIt only needs the first 3 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":1631990801379,"_cnpm_publish_time":1631990801379,"dist-tags":{"latest":"2.0.0"}}