mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-11 13:30:01 -04:00
tweaks to load wasm from node fs
This commit is contained in:
parent
87b887a4b7
commit
50671f5837
1 changed files with 8 additions and 2 deletions
|
@ -94,9 +94,15 @@ function load_wasm(url) {
|
|||
|
||||
//skip this if we are running in single file mode
|
||||
if (!wasmBinaryFile || !isDataURI(wasmBinaryFile)) {
|
||||
wasmBinaryFile = url;
|
||||
if (ENVIRONMENT_IS_NODE) {
|
||||
let fs = require("node:fs");
|
||||
wasmBinary = fs.readFileSync(url);
|
||||
}
|
||||
else {
|
||||
wasmBinaryFile = url;
|
||||
}
|
||||
createWasm();
|
||||
run();
|
||||
run();
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue