{"_id":"@discourse/heic","name":"@discourse/heic","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@discourse/heic","version":"1.0.0","main":"index.js","description":"Wasm HEIC decoder supporting the browser. Decode iPhone HEIC photos to ImageData.","repository":{"type":"git","url":"git+https://github.com/discourse/jSquash.git"},"author":{"name":"Jamie Sinclair","email":"jamsinclairnz+npm@gmail.com"},"keywords":["image","optimisation","optimization","squoosh","wasm","webassembly","heic","heif","iphone"],"license":"Apache-2.0","scripts":{"clean":"rm -rf dist","build:codec":"cd codec && npm run build","build":"npm run clean && tsc && cp -r codec package.json README.md *.d.ts .npmignore ../../LICENSE dist && cd dist/codec","prepublishOnly":"[[ \"$PWD\" == *'/dist' ]] && exit 0 || (echo 'Please run npm publish from the dist directory' && exit 1)"},"devDependencies":{"@types/node":"^20.9.2","typescript":"^4.4.4"},"type":"module","sideEffects":false,"publishConfig":{"access":"public"},"_id":"@discourse/heic@1.0.0","gitHead":"345892e0e48b428d47875a5b5678fbcf58f2880e","types":"./index.d.ts","bugs":{"url":"https://github.com/discourse/jSquash/issues"},"homepage":"https://github.com/discourse/jSquash#readme","_nodeVersion":"24.5.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-YMW5o0bHvhL4rjzGt7kpr8geqMEhP7yS20Hh5eMJtDOmHuCqn+icpNLr1ImFygU/yN39MUHVenETXcpDG6PPww==","shasum":"6066871965baebaf9eeccf60f3049c947066e299","tarball":"https://registry.npmjs.org/@discourse/heic/-/heic-1.0.0.tgz","fileCount":16,"unpackedSize":1043375,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGh6YOttD2gMvMsgNbBwG/tXExThkdYaHJz3zj1wmCF2AiAyraTPKES6AbFv6biHZH5CR5TdY+CYrmu3Z0nf96Y9VA=="}]},"_npmUser":{"name":"falcofantastic","email":"rafael@discourse.org"},"directories":{},"maintainers":[{"name":"cvx-pl","email":"jarek@cvx.dev"},{"name":"discourse-npm","email":"team@discourse.org"},{"name":"sam.saffron","email":"sam.saffron@gmail.com"},{"name":"joffreyjaffeux","email":"j.jaffeux@gmail.com"},{"name":"pmusaraj","email":"pmusaraj@gmail.com"},{"name":"davidtaylorhq","email":"david@taylorhq.com"},{"name":"keegangeorge","email":"kgeorge13@gmail.com"},{"name":"falcofantastic","email":"rafael@discourse.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/heic_1.0.0_1778182039410_0.2994313456756734"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T19:27:19.313Z","1.0.0":"2026-05-07T19:27:19.689Z","modified":"2026-05-07T19:27:19.975Z"},"maintainers":[{"name":"cvx-pl","email":"jarek@cvx.dev"},{"name":"discourse-npm","email":"team@discourse.org"},{"name":"sam.saffron","email":"sam.saffron@gmail.com"},{"name":"joffreyjaffeux","email":"j.jaffeux@gmail.com"},{"name":"pmusaraj","email":"pmusaraj@gmail.com"},{"name":"davidtaylorhq","email":"david@taylorhq.com"},{"name":"keegangeorge","email":"kgeorge13@gmail.com"},{"name":"falcofantastic","email":"rafael@discourse.org"}],"description":"Wasm HEIC decoder supporting the browser. Decode iPhone HEIC photos to ImageData.","homepage":"https://github.com/discourse/jSquash#readme","keywords":["image","optimisation","optimization","squoosh","wasm","webassembly","heic","heif","iphone"],"repository":{"type":"git","url":"git+https://github.com/discourse/jSquash.git"},"author":{"name":"Jamie Sinclair","email":"jamsinclairnz+npm@gmail.com"},"bugs":{"url":"https://github.com/discourse/jSquash/issues"},"license":"Apache-2.0","readme":"# @jsquash/heic\n\n[![npm version](https://badge.fury.io/js/@jsquash%2Fheic.svg)](https://badge.fury.io/js/@jsquash%2Fheic)\n\nAn easy way to decode HEIC and HEIF images in the browser with WebAssembly.\n\nUses [libheif](https://github.com/strukturag/libheif) and [libde265](https://github.com/strukturag/libde265).\n\nA [jSquash](https://github.com/jamsinclair/jSquash) package.\n\n## Installation\n\n```shell\nnpm install --save @jsquash/heic\n```\n\n## Usage\n\nNote: You will need to either manually include the wasm files from the codec directory or use a bundler like WebPack or Rollup to include them in your app/server.\n\n### `decode(data: ArrayBuffer): Promise<ImageData>`\n\nDecodes HEIC or HEIF binary data to `ImageData`.\n\n```js\nimport { decode } from '@jsquash/heic';\n\nconst imageBuffer = await fetch('/example.heic').then((res) => res.arrayBuffer());\nconst imageData = await decode(imageBuffer);\n```\n\n## Manual WASM initialisation (not recommended)\n\nThe `decode` module exports an `init` function that can be used to manually load the wasm module.\n\n```js\nimport decode, { init as initHeicDecode } from '@jsquash/heic/decode';\n\ninitHeicDecode(WASM_MODULE);\nconst image = await fetch('./image.heic').then((res) => res.arrayBuffer()).then(decode);\n```\n\nYou can also pass custom options to the `init` function to customise the behaviour of the module. See the [Emscripten documentation](https://emscripten.org/docs/api_reference/module.html#Module) for more information.\n\n```js\nimport decode, { init as initHeicDecode } from '@jsquash/heic/decode';\n\ninitHeicDecode(null, {\n  locateFile: (path, prefix) => `https://example.com/${prefix}/${path}`,\n});\n```\n","readmeFilename":"README.md","_rev":"1-5b8bc8e6dc76dd58cb115557a4572340"}