{"name":"is-tif","version":"2.0.0","description":"Check if a Buffer/Uint8Array is a TIFF image","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/is-tif.git"},"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":["tif","tiff","graphics","image","img","pic","picture","photo","type","detect","check","is","exif","binary","buffer","uint8array"],"devDependencies":{"ava":"^3.15.0","read-chunk":"^4.0.0","xo":"^0.44.0"},"gitHead":"c42732994efe35e6185191ba263858c370453b02","bugs":{"url":"https://github.com/sindresorhus/is-tif/issues"},"homepage":"https://github.com/sindresorhus/is-tif#readme","_id":"is-tif@2.0.0","_nodeVersion":"12.22.1","_npmVersion":"7.10.0","dist":{"integrity":"sha512-YEQPDqGNgLyhmC0lwX9pZidlMUb2tgayqIitnySWqkr8CcfNOhWACZETtlBDo+4VCxeoULUof5XRBaXwX3FrUQ==","shasum":"a1c29c6d4926c955d4d4cbd07e7f16b5640271fe","tarball":"http://registry-npm.ywwl.com/is-tif/download/is-tif-2.0.0.tgz","fileCount":4,"unpackedSize":2916,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEYb5CRA9TVsSAnZWagAALmcP/1hK00+hIcF2NZVPhqEn\nR79bSZehUdUGzJNwRYoEAui6u+K0ZgfTt58wZstT+JHloYQVwuo6magu2ZCV\n0KXZRpc8bPRKLjEOF1kuMsNU6DGoa4yOQ9zU615iGVINOjsVRIiwnYs42qqA\n4px5oTN5yCpIv3oVz2rI8cAwZmT49DI4rLCxh+90TGErXtCBPj+cvWkTvoLR\ntzM9lZMErw9XvGz6a8LsQ1YdaNe7IZaUUi0MeLBLsuBeuE5DT5ducaWuLpOU\ni+nEDAvvWYrj0sVabk/epmWJWYjPiiT+scrgeqwAOsmdIik/vtc4/JeEKpCa\n1ocEN9zHba1ng4RQC5aDJ/idpbbLoXNW5iXso7K+0vrGnQUcgau5Su+tKorg\nJwIMnJkwXxE3MyYoSnfo/6OtBQWiSxXeXJDOaZavNuD5lyHQvr25IqrHiPk7\nk4X69gD8S+mm1/+hMOInWCfHT3b8+rBvAu4ZeIHSXJTJN0MeT0ABsnk9Qnbs\nk9RI+kIG2zLKzecHpksxZd00tKcdDPOmGBM+7qNJq3ljFt3eBMarwjjeWnK3\ndrQzeX/f2CD9ejt9qLz7b+PWqxCdxD46tm32aNdK9IaTOu+AoFVmlaNFkPAy\nGn8qxbZ/PCm8WxlmfRR8oP5Ur0hKg86fYSIVES9sUS8U7v54c1jdkaPogaGs\n7dup\r\n=wfUz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaG6pPzVsgolM5rBJWgDXRFzTe1wVJCdySVcUjJ1cVGAiEA+92s5YIqUNT3lA1r5KY6idztxCpo7whlhMF3G4/uROU="}],"size":1685,"noattachment":false,"key":"/is-tif/-/is-tif-2.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/is-tif_2.0.0_1628538616950_0.42572356482056817"},"_hasShrinkwrap":false,"readme":"# is-tif\n\n> Check if a Buffer/Uint8Array is a [TIFF](https://en.wikipedia.org/wiki/TIFF) image\n\n## Install\n\n```\n$ npm install is-tif\n```\n\n## Usage\n\n##### Node.js\n\n```js\nimport {readChunkSync} from 'read-chunk';\nimport isTif from 'is-tif';\n\nconst buffer = readChunkSync('unicorn.tif', {length: 4});\n\nisTif(buffer);\n//=> true\n```\n\n##### Browser\n\n```js\nconst xhr = new XMLHttpRequest();\nxhr.open('GET', 'unicorn.tif');\nxhr.responseType = 'arraybuffer';\n\nxhr.onload = () => {\n\tisTif(new Uint8Array(this.response));\n\t//=> true\n};\n\nxhr.send();\n```\n\n## API\n\n### isTif(buffer)\n\nAccepts a `Buffer` (Node.js) or `Uint8Array`.\n\nIt only needs the first 4 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":1628538617129,"_cnpm_publish_time":1628538617129,"dist-tags":{"latest":"2.0.0"}}