We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is possible to instruct setZXingModuleOverrides to locate the .wasm in a local directory? like returning ./src/to/.wasm/ ??
setZXingModuleOverrides
./src/to/.wasm/
The text was updated successfully, but these errors were encountered:
Not sure what your use case and runtime would be, but here's a small demo to use it locally in node.
File structure:
. ├── index.js ├── node_modules ├── package-lock.json ├── package.json └── zxing_reader.wasm
index.js:
index.js
import { setZXingModuleOverrides, readBarcodesFromImageFile, } from "zxing-wasm/reader"; import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; setZXingModuleOverrides({ wasmBinary: readFileSync( fileURLToPath(new URL("./zxing_reader.wasm", import.meta.url)), ), }); fetch( "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!", ) .then((resp) => resp.blob()) .then(readBarcodesFromImageFile) .then(console.log);
Sorry, something went wrong.
My solution:
setZXingModuleOverrides({ locateFile : () => { return "/assets/libs/zxing/zxing_full.wasm"; } });
No branches or pull requests
It is possible to instruct
setZXingModuleOverrides
to locate the .wasm in a local directory? like returning./src/to/.wasm/
??The text was updated successfully, but these errors were encountered: