second-state / ssvm-napi

SSVM Node.js Addon
Apache License 2.0
13 stars 3 forks source link

VM instantiation using Buffer (as apposed to string) #17

Closed tpmccallum closed 4 years ago

tpmccallum commented 4 years ago

At present the VM instantiation is coded to accept a hex string.

Joey is storing the native wasm executables and instantiating the VM using Buffer with the belief that SSVM no longer needs to convert native wasm into hex string any more.

When instantiating a VM instance, Joey gets the following error (node:22715) UnhandledPromiseRejectionWarning: Error: wasm file expected

Can SSVM be changed to accept Buffer instead of string?

Thank you

hydai commented 4 years ago

We've released ssvm@0.3.4 npm package, which supports vm instantiation using Buffer(Uint8Array).