{"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":{"integrity":"sha512-xMHM1A7OssYXcA/6hMN222KVQkSAG2HxnzGqKl6Kgzh+Dapj9bMI4UeGd3deytw/DpptGAq1HPDHQhWQtis+Ew==","shasum":"eec4e8620a2da9c89c7d99782688e41c41b9d589","tarball":"http://registry-npm.ywwl.com/is-bmp/download/is-bmp-1.0.1.tgz","fileCount":4,"unpackedSize":2912,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/ccIPpnw6DJTGhS6SHtx7vZS6Mwhz6a0hV/1Rd5cr7AiAzxJS/on6VCX0Stj9MYXQzVOxFYm5vLMhXU/SVec0wIg=="}],"size":1728,"noattachment":false,"key":"/is-bmp/-/is-bmp-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-bmp_1.0.1_1521736519668_0.6947538960996473"},"_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","publish_time":1521736519776,"_cnpm_publish_time":1521736519776,"dist-tags":{"latest":"2.0.0"}}