{"_id":"@cjser/is-jpg","name":"@cjser/is-jpg","dist-tags":{"latest":"3.0.0-cjser.2"},"versions":{"3.0.0-cjser.2":{"name":"@cjser/is-jpg","version":"3.0.0-cjser.2","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava"},"keywords":["jpg","jpeg","image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"ava":"^3.15.0","read-chunk":"^4.0.2","xo":"^0.44.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.0.0","cjserVersion":2,"original":{"name":"is-jpg","version":"3.0.0","exports":"./index.js","repository":"sindresorhus/is-jpg","files":["index.js"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/is-jpg@3.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-ms3pTPUHWMtms/1wonDhBuyloo5a1ivFXx9T8R4Tgo6S+xrB+8pZPcREmZeLktfHB5qRA4oCbmVr1XKOci2kJg==","shasum":"3905ed4db72cb51dbe83d32dcf420df236d2781e","tarball":"https://registry.npmjs.org/@cjser/is-jpg/-/is-jpg-3.0.0-cjser.2.tgz","fileCount":5,"unpackedSize":4816,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCUvBOSHSRKtnCDmcFEYmKvWt82VPi2gx180kLG1VngUAIhAJqpG0c5G0fhpziFgg0FQJnWbrS/ftrFD66ymY8Mknyi"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is-jpg_3.0.0-cjser.2_1778158744543_0.582976454410701"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T12:59:04.442Z","3.0.0-cjser.2":"2026-05-07T12:59:04.674Z","modified":"2026-05-07T12:59:04.911Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Check if a Buffer/Uint8Array is a JPEG image","keywords":["jpg","jpeg","image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# is-jpg\n\n> Check if a Buffer/Uint8Array is a [JPEG](https://en.wikipedia.org/wiki/JPEG) image\n\n## Install\n\n```sh\nnpm install is-jpg\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunk} from 'read-chunk';\nimport isJpg from 'is-jpg';\n\nconst buffer = await readChunk('unicorn.jpg', {length: 3});\n\nisJpg(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.jpg');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\tisJpg(new Uint8Array(this.response));\n\t//=> true\n};\n\nxhr.send();\n```\n\n## API\n\n### isJpg(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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/is-jpg\n","readmeFilename":"readme.md","_rev":"1-919f3afef0c36e8f9717c65a397a08ad"}