Module.ccall()

Module.ccall() calls a compiled C function from JavaScript and returns the result of that function. The function signature for Module.ccall() is as follows:

ccall(ident, returnType, argTypes, args, opts)

You must specify a type name for the returnType and argTypes parameters. The possible types are "number", "string", "array", and "boolean", which correspond to the appropriate JavaScript types. You cannot specify "array" for the returnType parameter because there is no way to know the length of the array. If the function doesn't return anything, you can specify null for the returnType (note the absence of quotation marks).

The opts parameter is an optional options object that can contain a Boolean property named async. Specifying ...

Get Learn WebAssembly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.