Skip to content
New issue

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

Check wasm available functions #25

Open
valavanisleonidas opened this issue Dec 11, 2023 · 1 comment
Open

Check wasm available functions #25

valavanisleonidas opened this issue Dec 11, 2023 · 1 comment

Comments

@valavanisleonidas
Copy link

Hey,

I have loaded my wasm with WebAssembly.instantiate and i want to check the available functions because I am not sure which one is the name to call. Is that possible ?? I saw in an example

const importObject: any = {
        env: {
            print: function (x: any) { console.log(x); } // map the zig function print to the JS function console.log(x)
        },
    };

  const localModule1 = await WebAssembly.instantiate(LocalHello, importObject);

const fn = localModule1.instance.exports;
console.log(fn);

but it doesn't work.

@valavanisleonidas
Copy link
Author

Checking the repository you suggested and loading the wasm using this library i get an error in the init function of the instance.exports.init() here. is this supported in this library ?? Thanks @cawfree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant