{"_id":"is-bmp","_rev":"708335","name":"is-bmp","description":"Check if a Buffer/Uint8Array is a BMP image","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-09-02T14:25:53.000Z","created":"2014-04-21T17:36:24.371Z","2.0.0":"2021-09-02T14:14:34.280Z","1.0.1":"2018-03-22T16:35:19.776Z","1.0.0":"2014-08-14T14:40:19.318Z","0.1.1":"2014-04-29T19:08:10.619Z","0.1.0":"2014-04-21T17:36:24.371Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-bmp.git"},"versions":{"2.0.0":{"name":"is-bmp","version":"2.0.0","description":"Check if a Buffer/Uint8Array is a BMP image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-bmp.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":["bmp","bitmap","graphics","image","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"ava":"^3.15.0","read-chunk":"^4.0.1","xo":"^0.44.0"},"gitHead":"04ccd3fd23acfbd4bffbb88718824bafa0ff19d7","bugs":{"url":"https://github.com/sindresorhus/is-bmp/issues"},"homepage":"https://github.com/sindresorhus/is-bmp#readme","_id":"is-bmp@2.0.0","_nodeVersion":"14.17.5","_npmVersion":"7.20.3","dist":{"shasum":"fb995f2e6dfabfecd904b8c9d202a936d4d03153","size":1685,"noattachment":false,"key":"/is-bmp/-/is-bmp-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-bmp/download/is-bmp-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-bmp_2.0.0_1630592074147_0.10883862237007347"},"_hasShrinkwrap":false,"publish_time":1630592074280,"_cnpm_publish_time":1630592074280},"1.0.1":{"name":"is-bmp","version":"1.0.1","description":"Check if a Buffer/Uint8Array is a BMP image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-bmp.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":["bmp","bitmap","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"9597717d8d9b251db7b4d3815fe83704985df9f4","bugs":{"url":"https://github.com/sindresorhus/is-bmp/issues"},"homepage":"https://github.com/sindresorhus/is-bmp#readme","_id":"is-bmp@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"eec4e8620a2da9c89c7d99782688e41c41b9d589","size":1728,"noattachment":false,"key":"/is-bmp/-/is-bmp-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-bmp/download/is-bmp-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-bmp_1.0.1_1521736519668_0.6947538960996473"},"_hasShrinkwrap":false,"publish_time":1521736519776,"_cnpm_publish_time":1521736519776},"1.0.0":{"name":"is-bmp","version":"1.0.0","description":"Check if a Buffer/Uint8Array is a BMP image","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/is-bmp"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"http://sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"files":["index.js"],"keywords":["bmp","bitmap","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"mocha":"*","read-chunk":"^1.0.0"},"gitHead":"7f596a77313e1c736a21427b97d14720af5a8980","bugs":{"url":"https://github.com/sindresorhus/is-bmp/issues"},"homepage":"https://github.com/sindresorhus/is-bmp","_id":"is-bmp@1.0.0","_shasum":"f1866f1709cea3d4d2cf458a6347bb1df3657199","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"dist":{"shasum":"f1866f1709cea3d4d2cf458a6347bb1df3657199","size":1067,"noattachment":false,"key":"/is-bmp/-/is-bmp-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-bmp/download/is-bmp-1.0.0.tgz"},"directories":{},"publish_time":1408027219318,"_cnpm_publish_time":1408027219318,"_hasShrinkwrap":false},"0.1.1":{"name":"is-bmp","version":"0.1.1","description":"Check if a Buffer/Uint8Array is a BMP image","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/is-bmp"},"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":["bmp","bitmap","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-bmp/issues"},"homepage":"https://github.com/sindresorhus/is-bmp","_id":"is-bmp@0.1.1","dist":{"shasum":"4efaf2199399d70ef5f7a1a4db3bc2c9dd50b5d3","size":1125,"noattachment":false,"key":"/is-bmp/-/is-bmp-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-bmp/download/is-bmp-0.1.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398798490619,"_cnpm_publish_time":1398798490619,"_hasShrinkwrap":false},"0.1.0":{"name":"is-bmp","version":"0.1.0","description":"Check if a Buffer/Uint8Array is a BMP image","license":"MIT","repository":{"type":"git","url":"git://github.com/sindresorhus/is-bmp"},"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":["bmp","bitmap","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"browserify":"^3.0.0","mocha":"*","read-chunk":"^0.1.0"},"bugs":{"url":"https://github.com/sindresorhus/is-bmp/issues"},"homepage":"https://github.com/sindresorhus/is-bmp","_id":"is-bmp@0.1.0","dist":{"shasum":"d8ea726ca8ee20b06ac3c5e04dd61af4bf5622fa","size":1125,"noattachment":false,"key":"/is-bmp/-/is-bmp-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/is-bmp/download/is-bmp-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1398101784371,"_cnpm_publish_time":1398101784371,"_hasShrinkwrap":false}},"readme":"# is-bmp\n\n> Check if a Buffer/Uint8Array is a [BMP](https://en.m.wikipedia.org/wiki/BMP_file_format) image\n\n## Install\n\n```\n$ npm install is-bmp\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunk} from 'read-chunk';\nimport isBmp from 'is-bmp';\n\nconst buffer = await readChunk('unicorn.bmp', {length: 2});\n\nisBmp(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.bmp');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\tisBmp(new Uint8Array(this.response));\n\t//=> true\n};\n\nxhr.send();\n```\n\n## API\n\n### isBmp(buffer)\n\nAccepts a `Buffer` (Node.js) or `Uint8Array`.\n\nIt only needs the first 2 bytes.\n\n## Related\n\n- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array\n","_attachments":{},"homepage":"https://github.com/sindresorhus/is-bmp#readme","bugs":{"url":"https://github.com/sindresorhus/is-bmp/issues"},"license":"MIT"}