{"_id":"is-jpg","_rev":"18-5906b99c19b732637ce2d6450d00876e","name":"is-jpg","description":"Check if a Buffer/Uint8Array is a JPEG image","dist-tags":{"latest":"3.0.0"},"versions":{"0.1.0":{"name":"is-jpg","version":"0.1.0","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"git://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","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js"],"keywords":["jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg","_id":"is-jpg@0.1.0","dist":{"shasum":"47e5f051a25baa4c1d19b58ffc8dadcd99b48081","tarball":"https://registry.npmjs.org/is-jpg/-/is-jpg-0.1.0.tgz","integrity":"sha512-832SHazotNe0uM4OhsuKvoquEJ22wGIao4jLqbenLIxG71kzKOi+WBlk/o19rR6F7HXfvVaORnf8oortJ3sqdQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzCColplJz1QrvP1gvuBrdJlaAyG1nGsa8CIAMq8m42wIgBA6mmLr+CiC5jACke0FeNhyCaPDavh/rFGZizPviSLc="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"0.1.1":{"name":"is-jpg","version":"0.1.1","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"git://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","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js"],"keywords":["jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg","_id":"is-jpg@0.1.1","dist":{"shasum":"b9c040efd7d2ae176e8c5938ba8f243e1e9a9d0a","tarball":"https://registry.npmjs.org/is-jpg/-/is-jpg-0.1.1.tgz","integrity":"sha512-g/Z+V0zkFgqI+basl1KcRHDsNQHd6uizrYEMQHbvBnl22I9QuKbseR3iU9UIm1P8qCCPJ40GAA2QHrQPueoApQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFtDby7oH2jGHwiEXwz3k9wmu9mBXoK1cJuQUb66wouAiAG8LUPv0oDkrgpGdSeGqrERnGz9yrm1qSsQD7VdjG5ZQ=="}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"0.1.2":{"name":"is-jpg","version":"0.1.2","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"git://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","browser":"browserify -s $npm_package_name -o browser.js ."},"files":["index.js"],"keywords":["jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg","_id":"is-jpg@0.1.2","dist":{"shasum":"a56f6f01fdef4baf448dc44bc6f99cbc9c536715","tarball":"https://registry.npmjs.org/is-jpg/-/is-jpg-0.1.2.tgz","integrity":"sha512-WfXhQJzA2PdP1jEct3DQbwI7Dyq1he6e+LHYVFEBuxark/KuL0AJV5b2iTX3JduxVKEvqusd3ysS/cFOwGs3iQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7izlFICpQyJmkGXglQDC+lDkdoEtZogNWheTqF4srEAIhAO7csPxC6ct4F3wn81CIdbUfWO6LJy5QRYIWA8IqIWWq"}]},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{}},"1.0.0":{"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":"https://registry.npmjs.org/is-jpg/-/is-jpg-1.0.0.tgz","integrity":"sha512-ogyPbPwwvjnCKx/5v6r/t7vv6CBkAoqzTeC77smNUEbO8n/twiLAfDneUzMxCEi6VWGLJVmdAKCJb47/2ff/IQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH3hoTJs85MajCubdzBwFBLKtZOqDK3EjAh76IdBJAMiAiEAih9tT74qThT3z9ILB8WVXDjeH8WoVPFQsC7yfr821fA="}]},"directories":{}},"1.0.1":{"name":"is-jpg","version":"1.0.1","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-jpg.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":["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":"e2973d0cca3db187712f716660f393e169a82ce1","bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg#readme","_id":"is-jpg@1.0.1","_shasum":"296d57fdd99ce010434a7283e346ab9a1035e975","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"296d57fdd99ce010434a7283e346ab9a1035e975","tarball":"https://registry.npmjs.org/is-jpg/-/is-jpg-1.0.1.tgz","fileCount":4,"unpackedSize":2931,"integrity":"sha512-X5PVpLMBH/OaeTN8quzbcLTlwXCb/6n3tcfYTtEDzp0ZwAlgAOtIAIBHN4mS5OcscMgO8etZ5Ol1mNrXSqwBVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+6IC/uHOLJhlCyrHkuWO/VKhN0MYMV/RO0xurLbi9eAiEAjj2qn8QXVQVGNrpYfcWneeoS2rJeEIeR+oFeIN2HtB4="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-jpg_1.0.1_1521733408058_0.5738571946469975"},"_hasShrinkwrap":false},"2.0.0":{"name":"is-jpg","version":"2.0.0","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-jpg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"devDependencies":{"ava":"*","read-chunk":"^2.1.0","xo":"*"},"gitHead":"3fd03502026a4dca98fd38748344ac71b4110465","bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg#readme","_id":"is-jpg@2.0.0","_shasum":"2e1997fa6e9166eaac0242daae443403e4ef1d97","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2e1997fa6e9166eaac0242daae443403e4ef1d97","tarball":"https://registry.npmjs.org/is-jpg/-/is-jpg-2.0.0.tgz","fileCount":4,"unpackedSize":2955,"integrity":"sha512-ODlO0ruzhkzD3sdynIainVP5eoOFNN85rxA1+cwwnPe4dKyX0r5+hxNO5XpCrxlHcmb9vkOit9mhRD2JVuimHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOtTxscu0SqN/yzovcRIO04IppUtDcyJSmTureepEJJQIgTgMDV94B2KXNbnk0xr8cfKQKNy9N66n80oXn2z7bIF8="}]},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-jpg_2.0.0_1521733969185_0.5522490664673865"},"_hasShrinkwrap":false},"3.0.0":{"name":"is-jpg","version":"3.0.0","description":"Check if a Buffer/Uint8Array is a JPEG image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-jpg.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":["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"},"gitHead":"a1f9fc4dfaed76e043b54cfdf84361e2a1e7a354","bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"homepage":"https://github.com/sindresorhus/is-jpg#readme","_id":"is-jpg@3.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"integrity":"sha512-Vcd67KWHZblEKEBrtP25qLZ8wN9ICoAhl1pKUqD7SM7hf2qtuRl7loDgP5Zigh2oN/+7uj+KVyC0eRJvgOEFeQ==","shasum":"f97b4ab6de92401650cb4f54ec0a6ad79c51367f","tarball":"https://registry.npmjs.org/is-jpg/-/is-jpg-3.0.0.tgz","fileCount":4,"unpackedSize":2820,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2wE9CRA9TVsSAnZWagAA/tcP+gMCkA0ycZ6DXN0Pnj6R\nDToTGchXJlxkz0UAqIMG0xvHyrGil0oGsYg31tUrYSqagxVpUrUnrIy5W4rB\n9O+ygpRFd202BlSQVxhDX9SEaPng4Gf744nNEgqLEDoA/UsgUOQvIVBvyPS1\niX5KdzCqNbVsq/Nh71SujmRpNHpL7DDTxNudHmUGyA3tgY7HJkV1neW5v1JD\nAjx6dLGGZ3IqGyw8eYpb1r99USk6wvPUoC3oLs85gDukTdJz1ThvwHMBczxk\nCu7MhFEpepMTzJcYh5UwFOhyrK8eqeJD/8DRv36A9Eh+90k4DTSxxftw9sAI\n7XH34jmpjt5Cbo+zG5wlD4zwrmlMqMBnPkD5pW30z4fDuLJVdYCstiSu1MQs\nG7PtJgX5sdQl/QGg4x5aHunUtOywEY7QlY/N//C5+udgNrNbHg9NtGDPk/4O\n2q61UVVd0OVWVnFfAi08PvipxYLepVtF2dD499cy2xd/9QSa2P7DFT1rPm0V\nbqIaYDhYefxihotGm9cMeh4bMDhXDPqM46Tws7vj4FLCA7+dHBCBIMcys2A6\nBUXxYR4unorH4PtDaDqbf8UByn8O3d+2FTgciYYcoVvhjSPD4USpR4fDgThn\nJY5GgvYuf7pk5kNWZNnYp9brwCVn5s8Rt0WnQtrC/danRhSKOIyac0i20Auv\ndT54\r\n=v6/c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9A84lHkBqZp7eFTyzrHyd2SQ2J/mr02PoVrXXryhbJAiEAkr8x85mWN6L86lXp/kHfsf09CAhHkJ6Vsjl3wOVTxY4="}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-jpg_3.0.0_1632039676545_0.9755457171538562"},"_hasShrinkwrap":false}},"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","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"time":{"modified":"2022-06-19T02:44:11.116Z","created":"2014-04-21T17:29:40.577Z","0.1.0":"2014-04-21T17:29:40.577Z","0.1.1":"2014-04-25T23:32:59.719Z","0.1.2":"2014-04-29T19:11:12.916Z","1.0.0":"2014-08-14T14:39:20.490Z","1.0.1":"2018-03-22T15:43:28.099Z","2.0.0":"2018-03-22T15:52:49.394Z","3.0.0":"2021-09-19T08:21:16.870Z"},"homepage":"https://github.com/sindresorhus/is-jpg#readme","keywords":["jpg","jpeg","image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-jpg.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/is-jpg/issues"},"license":"MIT","readmeFilename":"readme.md","users":{"anhulife":true,"akiva":true,"rocket0191":true}}