{"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":"sindresorhus@gmail.com"}],"dist":{"shasum":"f1866f1709cea3d4d2cf458a6347bb1df3657199","tarball":"http://registry-npm.ywwl.com/is-bmp/download/is-bmp-1.0.0.tgz","integrity":"sha512-Z2S0xQKZzEHUiAaCERitzreSPqY1SdVcBMveg0UmRo1TlcBn2G0eqZMIU9gIfUFxY+zx0ctgkXB35HUF4/wF2Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHebCQbhUhK1rDkkaxwv+5zIS1GUpj/AcnwzWRHwGugBAiB7ecizb6bsK0++dDG8M262HyQoiz356aEOzNTFLK3lgQ=="}],"size":1067,"noattachment":false,"key":"/is-bmp/-/is-bmp-1.0.0.tgz"},"directories":{},"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":1408027219318,"_cnpm_publish_time":1408027219318,"dist-tags":{"latest":"2.0.0"}}