From 5a8ad3a4ae9fc65f40e832a0cd3e29e3ce85b6bd Mon Sep 17 00:00:00 2001 From: Darwin Date: Wed, 31 Jul 2024 10:15:03 +0200 Subject: [PATCH] docs: fix code syntax errors in loader --- loader/README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/loader/README.md b/loader/README.md index fabdcd002..998065e3b 100644 --- a/loader/README.md +++ b/loader/README.md @@ -34,12 +34,12 @@ const env = { // Create the handle function that executes the Wasm const handle = await AoLoader(wasmBinary, { - format = "wasm32-unknown-emscripten2", - inputEncoding = "JSON-1", - outputEncoding = "JSON-1", - memoryLimit = "524288000", // in bytes - computeLimit = 9e12.toString(), - extensions = [] + format: "wasm32-unknown-emscripten2", + inputEncoding: "JSON-1", + outputEncoding: "JSON-1", + memoryLimit: "524288000", // in bytes + computeLimit: 9e12.toString(), + extensions: [] }); // To spawn a process, pass null as the buffer @@ -58,12 +58,12 @@ const result = await handle(null, { ```js const options = { - format = "wasm32-unknown-emscripten2", - inputEncoding = "JSON-1", - outputEncoding = "JSON-1", - memoryLimit = "524288000", // in bytes - computeLimit = 9e12.toString(), - extensions = [] + format: "wasm32-unknown-emscripten2", + inputEncoding: "JSON-1", + outputEncoding: "JSON-1", + memoryLimit: "524288000", // in bytes + computeLimit: 9e12.toString(), + extensions: [] } const handle = await AoLoader(wasmBinary, options); const buffer = await LoadFromCache(); @@ -96,12 +96,12 @@ import fs from "fs"; async function main() { const wasmBinary = fs.readFileSync("process.wasm"); const options = { - format = "wasm32-unknown-emscripten2", - inputEncoding = "JSON-1", - outputEncoding = "JSON-1", - memoryLimit = "524288000", // in bytes - computeLimit = 9e12.toString(), - extensions = [] + format: "wasm32-unknown-emscripten2", + inputEncoding: "JSON-1", + outputEncoding: "JSON-1", + memoryLimit: "524288000", // in bytes + computeLimit: 9e12.toString(), + extensions: [] } const handle = AoLoader(wasmBinary, options); const result = await handle(...); @@ -121,12 +121,12 @@ async function main() { const wasmBinary = await fetch(`https://arweave.net/${tx_id}`) .then(res => res.arrayBuffer()) const options = { - format = "wasm32-unknown-emscripten2", - inputEncoding = "JSON-1", - outputEncoding = "JSON-1", - memoryLimit = "524288000", // in bytes - computeLimit = 9e12.toString(), - extensions = [] + format: "wasm32-unknown-emscripten2", + inputEncoding: "JSON-1", + outputEncoding: "JSON-1", + memoryLimit: "524288000", // in bytes + computeLimit: 9e12.toString(), + extensions: [] } const handle = AoLoader(wasmBinary, options);