neo-decompiler-web
v0.9.0
Published
TypeScript wrapper for the Neo decompiler WebAssembly bindings
Maintainers
Readme
Neo Decompiler Web Package
This folder contains the publishable npm package for the Rust crate compiled to WebAssembly. It adds a thin TypeScript wrapper over the wasm bindings so browser code gets a stable, typed API without duplicating the decompiler logic.
Build
From this directory:
npm install
npm run build:wasmThat runs wasm-pack build .. --target web --out-dir web/dist/pkg --features web --no-default-features
followed by scripts/prepare-wasm-package.mjs, generating the wasm glue under
web/dist/pkg/.
Then build the TypeScript wrapper:
npm run build:tsFor a full package build:
npm run build:packageServe
From this directory:
python3 -m http.server 4173Then open http://localhost:4173.
JS API
import {
init,
initPanicHook,
infoReport,
disasmReport,
decompileReport,
} from "neo-decompiler-web";
await init();
initPanicHook();
const info = infoReport(nefBytes, {
manifestJson,
strictManifest: false,
});
const disasm = disasmReport(nefBytes, {
failOnUnknownOpcodes: false,
});
const decompile = decompileReport(nefBytes, {
manifestJson,
strictManifest: false,
failOnUnknownOpcodes: false,
inlineSingleUseTemps: true,
outputFormat: "all",
});nefBytes should be a Uint8Array. manifestJson should be a UTF-8 JSON string.
The wrapper accepts camelCase JS options and translates them into the snake_case
ABI expected by the wasm bindings. The published npm tarball includes the
compiled TypeScript wrapper plus the wasm artifacts under dist/pkg/.
