{"_id":"image-type","_rev":"3212364","name":"image-type","description":"Detect the image type of a Buffer/Uint8Array","dist-tags":{"latest":"5.2.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2024-02-22T02:25:28.000Z","created":"2014-04-21T17:52:54.677Z","5.2.0":"2023-01-15T00:04:36.656Z","5.1.0":"2022-09-24T16:52:17.895Z","5.0.0":"2022-07-29T23:28:23.232Z","4.1.0":"2019-04-06T07:16:49.841Z","4.0.0":"2019-03-06T06:40:36.472Z","3.1.0":"2019-03-06T06:38:00.187Z","3.0.0":"2017-01-19T17:44:44.690Z","2.1.0":"2015-10-11T15:15:00.966Z","2.0.2":"2015-02-16T17:55:29.993Z","2.0.1":"2014-12-19T03:05:28.971Z","2.0.0":"2014-12-19T03:04:19.981Z","1.1.0":"2014-10-29T06:47:14.821Z","1.0.0":"2014-08-14T14:47:41.007Z","0.1.4":"2014-04-30T22:26:43.092Z","0.1.3":"2014-04-26T00:33:07.708Z","0.1.2":"2014-04-24T11:10:10.045Z","0.1.1":"2014-04-23T09:41:53.057Z","0.1.0":"2014-04-21T17:52:54.677Z"},"users":{"t1st3":true,"amit3vr":true,"klombomb":true,"chemzqm":true,"parkerproject":true,"mrbgit":true,"psbolden":true,"bengi":true,"abdihaikal":true,"faraoman":true,"rocket0191":true},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"versions":{"5.2.0":{"name":"image-type","version":"5.2.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^18.1.0"},"devDependencies":{"@types/node":"^18.11.18","ava":"^5.1.0","read-chunk":"^4.0.3","tsd":"^0.25.0","xo":"^0.53.1"},"gitHead":"b283630149204cdcf48aa7d76eaf6afd11ccd6bb","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@5.2.0","_nodeVersion":"14.21.1","_npmVersion":"8.19.2","dist":{"shasum":"4da3d6a5835978b3d12a667aeb58200a8490da26","size":2848,"noattachment":false,"key":"/image-type/-/image-type-5.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-5.2.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-type_5.2.0_1673741076488_0.11446978949100184"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-15T00:04:36.656Z","publish_time":1673741076656,"_cnpm_publish_time":1673741076656},"5.1.0":{"name":"image-type","version":"5.1.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^17.1.4"},"devDependencies":{"@types/node":"^18.6.2","ava":"^4.3.1","read-chunk":"^4.0.2","tsd":"^0.22.0","xo":"^0.51.0"},"gitHead":"a336b53a5c83e65937d9e4206daf394aff261154","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@5.1.0","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"shasum":"b5d780918d32c89fa2714ee0b5095cfa71dde16e","size":2852,"noattachment":false,"key":"/image-type/-/image-type-5.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-type_5.1.0_1664038337737_0.3271404193082008"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-24T17:04:52.499Z","publish_time":1664038337895,"_cnpm_publish_time":1664038337895},"5.0.0":{"name":"image-type","version":"5.0.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","types":"./index.d.ts","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^17.1.4"},"devDependencies":{"@types/node":"^18.6.2","ava":"^4.3.1","read-chunk":"^4.0.2","tsd":"^0.22.0","xo":"^0.51.0"},"gitHead":"fd839e5cd8a9fa6dc2da93b16e75f2141167b299","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@5.0.0","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"shasum":"69523dfcf7c4515dfaad2a4dd043b3aea0e4aea3","size":2842,"noattachment":false,"key":"/image-type/-/image-type-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-5.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-type_5.0.0_1659137303051_0.11257505446962335"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-29T23:36:12.321Z","publish_time":1659137303232,"_cnpm_publish_time":1659137303232},"4.1.0":{"name":"image-type","version":"4.1.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^10.10.0"},"devDependencies":{"@types/node":"^11.13.0","ava":"^1.4.1","read-chunk":"^3.2.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"5baa5af95286a9b89f66b11022e3230f72e38ca1","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@4.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"72a88d64ff5021371ed67b9a466442100be57cd1","size":3035,"noattachment":false,"key":"/image-type/-/image-type-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-4.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-type_4.1.0_1554535009690_0.5853952055539733"},"_hasShrinkwrap":false,"publish_time":1554535009841,"_cnpm_publish_time":1554535009841},"4.0.0":{"name":"image-type","version":"4.0.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^10.9.0"},"devDependencies":{"@types/node":"^11.10.4","ava":"^1.3.1","read-chunk":"^3.0.0","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"333daed89e27a7ca967ff88221ce959ca4e78cd6","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@4.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"91e84c887451644706ff3297360ff3d89881fac5","size":2867,"noattachment":false,"key":"/image-type/-/image-type-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-type_4.0.0_1551854436326_0.016372582616225984"},"_hasShrinkwrap":false,"publish_time":1551854436472,"_cnpm_publish_time":1551854436472},"3.1.0":{"name":"image-type","version":"3.1.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^10.9.0"},"devDependencies":{"@types/node":"^11.10.4","ava":"^1.3.1","read-chunk":"^3.0.0","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"80b0a1f97074947085539933e25f5aa58334ae44","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@3.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9148944c40c16d657174af2bd1af39d767c2c29f","size":2869,"noattachment":false,"key":"/image-type/-/image-type-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/image-type_3.1.0_1551854280050_0.2577795862895622"},"_hasShrinkwrap":false,"publish_time":1551854280187,"_cnpm_publish_time":1551854280187},"3.0.0":{"name":"image-type","version":"3.0.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/image-type.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^4.1.0"},"devDependencies":{"ava":"*","read-chunk":"^2.0.0","xo":"*"},"gitHead":"3fbcd9a089d66aea181c10f9fd0ec0d4f0d2ccb9","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type#readme","_id":"image-type@3.0.0","_shasum":"1502af3135f906e122c877c31e94af7b7a9146c5","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.6.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"1502af3135f906e122c877c31e94af7b7a9146c5","size":2159,"noattachment":false,"key":"/image-type/-/image-type-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/image-type-3.0.0.tgz_1484847882926_0.7932522117625922"},"directories":{},"publish_time":1484847884690,"_cnpm_publish_time":1484847884690,"_hasShrinkwrap":false},"2.1.0":{"name":"image-type","version":"2.1.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/image-type"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"bin":{"image-type":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["cli-app","cli","bin","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^3.0.0","meow":"^3.3.0"},"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"10a11127fd502055607553e3e7c460bfa13c431a","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@2.1.0","_shasum":"976f2388176447dca0d23317c275ba4875a35d02","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"976f2388176447dca0d23317c275ba4875a35d02","size":2534,"noattachment":false,"key":"/image-type/-/image-type-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1444576500966,"_cnpm_publish_time":1444576500966,"_hasShrinkwrap":false},"2.0.2":{"name":"image-type","version":"2.0.2","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/image-type"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"image-type":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^2.0.0","meow":"^3.0.0"},"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"e303f7fc1e0c92164ac33b9cfe394005b0f9bbab","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@2.0.2","_shasum":"97678f5025074d93e47c7545198e96d015d831f8","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"97678f5025074d93e47c7545198e96d015d831f8","size":2546,"noattachment":false,"key":"/image-type/-/image-type-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-2.0.2.tgz"},"directories":{},"publish_time":1424109329993,"_cnpm_publish_time":1424109329993,"_hasShrinkwrap":false},"2.0.1":{"name":"image-type","version":"2.0.1","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/image-type"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"image-type":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^2.0.0","meow":"^2.0.0"},"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"350e1c32a19d7d3212d16a952df455407944f403","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@2.0.1","_shasum":"ff6ec5d3b8bec51526f77fa16effef0a6d8b5d3b","_from":".","_npmVersion":"2.1.5","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"ff6ec5d3b8bec51526f77fa16effef0a6d8b5d3b","size":1854,"noattachment":false,"key":"/image-type/-/image-type-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-2.0.1.tgz"},"directories":{},"publish_time":1418958328971,"_cnpm_publish_time":1418958328971,"_hasShrinkwrap":false},"2.0.0":{"name":"image-type","version":"2.0.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/image-type"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"image-type":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"file-type":"^2.0.0","meow":"^2.0.0"},"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"a0bb243050a31ec3214917f921aa418d0ecd6dfa","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@2.0.0","_shasum":"370924b8c2e4f9893817e82053ba990ab8e8de56","_from":".","_npmVersion":"2.1.5","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"370924b8c2e4f9893817e82053ba990ab8e8de56","size":1830,"noattachment":false,"key":"/image-type/-/image-type-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-2.0.0.tgz"},"directories":{},"publish_time":1418958259981,"_cnpm_publish_time":1418958259981,"_hasShrinkwrap":false},"1.1.0":{"name":"image-type","version":"1.1.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/image-type"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"image-type":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"is-bmp":"^1.0.0","is-gif":"^1.0.0","is-jpg":"^1.0.0","is-jxr":"^1.0.0","is-png":"^1.0.0","is-psd":"^1.0.0","is-tif":"^1.0.0","is-webp":"^1.0.0","meow":"^2.0.0"},"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"92dcb0d13cbbd14b4277b952e16c371e1bcce1eb","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@1.1.0","_shasum":"74dbbfe31a290dee57751ffff32ea5a37940ef98","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"74dbbfe31a290dee57751ffff32ea5a37940ef98","size":1793,"noattachment":false,"key":"/image-type/-/image-type-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-1.1.0.tgz"},"directories":{},"publish_time":1414565234821,"_cnpm_publish_time":1414565234821,"_hasShrinkwrap":false},"1.0.0":{"name":"image-type","version":"1.0.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/image-type"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"bin":{"image-type":"cli.js"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd","mime"],"dependencies":{"is-bmp":"^1.0.0","is-gif":"^1.0.0","is-jpg":"^1.0.0","is-jxr":"^1.0.0","is-png":"^1.0.0","is-psd":"^1.0.0","is-tif":"^1.0.0","is-webp":"^1.0.0"},"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"b7c53eea401f28947217c76e9a0797901e033225","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@1.0.0","_shasum":"de74656481f0ff70d28797d05aa459416dbfca67","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"de74656481f0ff70d28797d05aa459416dbfca67","size":1834,"noattachment":false,"key":"/image-type/-/image-type-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-1.0.0.tgz"},"directories":{},"publish_time":1408027661007,"_cnpm_publish_time":1408027661007,"_hasShrinkwrap":false},"0.1.4":{"name":"image-type","version":"0.1.4","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/image-type"},"bin":{"image-type":"cli.js"},"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","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd"],"dependencies":{"is-bmp":"^0.1.0","is-gif":"^0.1.0","is-jpg":"^0.1.0","is-jxr":"^0.1.0","is-png":"^0.1.0","is-psd":"^0.1.0","is-tif":"^0.1.0","is-webp":"^0.1.0","read-chunk":"^0.1.0"},"devDependencies":{"browserify":"^3.0.0","mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@0.1.4","dist":{"shasum":"7cad622e2c1f2053c93599f0295a7b9ccdc161e8","size":1755,"noattachment":false,"key":"/image-type/-/image-type-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-0.1.4.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398896803092,"_cnpm_publish_time":1398896803092,"_hasShrinkwrap":false},"0.1.3":{"name":"image-type","version":"0.1.3","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/image-type"},"bin":{"image-type":"cli.js"},"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","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd"],"dependencies":{"is-bmp":"^0.1.0","is-gif":"^0.1.0","is-jpg":"^0.1.0","is-jxr":"^0.1.0","is-png":"^0.1.0","is-psd":"^0.1.0","is-tif":"^0.1.0","is-webp":"^0.1.0","read-chunk":"^0.1.0"},"devDependencies":{"browserify":"^3.0.0","mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@0.1.3","dist":{"shasum":"4eaadec6393a4f81b51b33f417e30c4e2fcbe024","size":1685,"noattachment":false,"key":"/image-type/-/image-type-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398472387708,"_cnpm_publish_time":1398472387708,"_hasShrinkwrap":false},"0.1.2":{"name":"image-type","version":"0.1.2","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/image-type"},"bin":{"image-type":"cli.js"},"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","cli.js"],"keywords":["image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin","png","jpg","jpeg","gif","webp","tif","bmp","jxr","psd"],"dependencies":{"is-bmp":"^0.1.0","is-gif":"^0.1.0","is-jpg":"^0.1.0","is-jxr":"^0.1.0","is-png":"^0.1.0","is-psd":"^0.1.0","is-tif":"^0.1.0","is-webp":"^0.1.0","read-chunk":"^0.1.0"},"devDependencies":{"browserify":"^3.0.0","mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@0.1.2","dist":{"shasum":"5189d77eac75f2ec14c834e67a2fdb99b2bffef6","size":1686,"noattachment":false,"key":"/image-type/-/image-type-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-0.1.2.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398337810045,"_cnpm_publish_time":1398337810045,"_hasShrinkwrap":false},"0.1.1":{"name":"image-type","version":"0.1.1","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/image-type"},"bin":{"image-type":"cli.js"},"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","cli.js"],"keywords":["jpg","jpeg","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array","cli","bin"],"dependencies":{"is-bmp":"^0.1.0","is-gif":"^0.1.0","is-jpg":"^0.1.0","is-jxr":"^0.1.0","is-png":"^0.1.0","is-psd":"^0.1.0","is-tif":"^0.1.0","is-webp":"^0.1.0","read-chunk":"^0.1.0"},"devDependencies":{"browserify":"^3.0.0","mocha":"*"},"bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@0.1.1","dist":{"shasum":"2f1218809a9748ee63a3c16420b900fa00964a12","size":1681,"noattachment":false,"key":"/image-type/-/image-type-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398246113057,"_cnpm_publish_time":1398246113057,"_hasShrinkwrap":false},"0.1.0":{"name":"image-type","version":"0.1.0","description":"Detect the image type of a Buffer/Uint8Array","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/image-type"},"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"],"dependencies":{"is-bmp":"^0.1.0","is-gif":"^0.1.0","is-jpg":"^0.1.0","is-jxr":"^0.1.0","is-png":"^0.1.0","is-psd":"^0.1.0","is-tif":"^0.1.0","is-webp":"^0.1.0"},"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"homepage":"https://github.com/sindresorhus/image-type","_id":"image-type@0.1.0","dist":{"shasum":"b1de457f45e6c3c6fce5a18d3aaa5e08f097c101","size":1324,"noattachment":false,"key":"/image-type/-/image-type-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/image-type/download/image-type-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398102774677,"_cnpm_publish_time":1398102774677,"_hasShrinkwrap":false}},"readme":"# image-type\n\n> Detect the image type of a Buffer/Uint8Array\n\nSee the [`file-type`](https://github.com/sindresorhus/file-type) module for more file types and a CLI.\n\n## Install\n\n```sh\nnpm install image-type\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunk} from 'read-chunk';\nimport imageType, {minimumBytes} from 'image-type';\n\nconst buffer = await readChunk('unicorn.png', {length: minimumBytes});\n\nawait imageType(buffer);\n//=> {ext: 'png', mime: 'image/png'}\n```\n\nOr from a remote location:\n\n```js\nimport https from 'node:https';\nimport imageType, {minimumBytes} from 'image-type';\n\nconst url = 'https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';\n\nhttps.get(url, response => {\n\tresponse.on('readable', () => {\n\t\t(async () => {\n\t\t\tconst chunk = response.read(minimumBytes);\n\t\t\tresponse.destroy();\n\t\t\tconsole.log(await imageType(chunk));\n\t\t\t//=> {ext: 'jpg', mime: 'image/jpeg'}\n\t\t})();\n\t});\n});\n```\n\n##### Browser\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.png');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\t(async () => {\n\t\tawait imageType(new Uint8Array(this.response));\n\t\t//=> {ext: 'png', mime: 'image/png'}\n\t})();\n};\n\nxhr.send();\n```\n\n## API\n\n### imageType(input)\n\nReturns an `Promise<object>` with:\n\n- `ext` - One of the [supported file types](#supported-file-types)\n- `mime` - The [MIME type](https://en.wikipedia.org/wiki/Internet_media_type)\n\nOr `undefined` when there is no match.\n\n#### input\n\nType: `Buffer | Uint8Array`\n\nIt only needs the first `minimumBytes` amount of bytes.\n\n### minimumBytes\n\nType: `number`\n\nThe minimum amount of bytes needed to detect a file type. Currently, it's 4100 bytes, but it can change, so don't hardcode it.\n\n## Supported file types\n\n- [`jpg`](https://en.wikipedia.org/wiki/JPEG)\n- [`png`](https://en.wikipedia.org/wiki/Portable_Network_Graphics)\n- [`gif`](https://en.wikipedia.org/wiki/GIF)\n- [`webp`](https://en.wikipedia.org/wiki/WebP)\n- [`flif`](https://en.wikipedia.org/wiki/Free_Lossless_Image_Format)\n- [`cr2`](https://fileinfo.com/extension/cr2)\n- [`tif`](https://en.wikipedia.org/wiki/Tagged_Image_File_Format)\n- [`bmp`](https://en.wikipedia.org/wiki/BMP_file_format)\n- [`jxr`](https://en.wikipedia.org/wiki/JPEG_XR)\n- [`psd`](https://en.wikipedia.org/wiki/Adobe_Photoshop#File_format)\n- [`ico`](https://en.wikipedia.org/wiki/ICO_(file_format))\n- [`bpg`](https://bellard.org/bpg/)\n- [`jp2`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000\n- [`jpm`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000\n- [`jpx`](https://en.wikipedia.org/wiki/JPEG_2000) - JPEG 2000\n- [`heic`](https://nokiatech.github.io/heif/technical.html)\n- [`cur`](https://en.wikipedia.org/wiki/ICO_(file_format))\n- [`dcm`](https://en.wikipedia.org/wiki/DICOM#Data_format) - DICOM Image File\n\n*SVG isn't included as it requires the whole file to be read, but you can get it [here](https://github.com/sindresorhus/is-svg).*\n","_attachments":{},"homepage":"https://github.com/sindresorhus/image-type#readme","bugs":{"url":"https://github.com/sindresorhus/image-type/issues"},"license":"MIT"}