{"name":"is-jpg","version":"1.0.0","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-jpg"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"da8e15c730519a7f0ae3ec16d4e2eb510ecd1e30","bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg","_id":"is-jpg@1.0.0","_shasum":"2959c17e73430db38264da75b90dd54f2d86da1c","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"dist":{"shasum":"2959c17e73430db38264da75b90dd54f2d86da1c","tarball":"http://registry-npm.ywwl.com/is-jpg/download/is-jpg-1.0.0.tgz","integrity":"sha512-ogyPbPwwvjnCKx/5v6r/t7vv6CBkAoqzTeC77smNUEbO8n/twiLAfDneUzMxCEi6VWGLJVmdAKCJb47/2ff/IQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3hoTJs85MajCubdzBwFBLKtZOqDK3EjAh76IdBJAMiAiEAih9tT74qThT3z9ILB8WVXDjeH8WoVPFQsC7yfr821fA="}],"size":1063,"noattachment":false,"key":"/is-jpg/-/is-jpg-1.0.0.tgz"},"directories":{},"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","publish_time":1408027160490,"_cnpm_publish_time":1408027160490,"dist-tags":{"latest":"3.0.0"}}