Can I deploy the same WASM javascript modules to node-chakracore as I can to nodejs v8?
Does node-chakracore support WASM (Web Assembly)?
347 Views Asked by Matt Hargett At
        	2
        	
        There are 2 best solutions below
0
                
                        
                            
                        
                        
                            On
                            
                                                    
                    
                Alternatively, you can use node-wasm to load your wasm file and then in your node js app, do this:
import loadWasm from 'node-wasm';
async function run() {
  const {rust_function} = await loadWasm('/local/path/to/wasm');
  const result = rust_function();
  console.log(result);
}
run();
There's a complete example here in the same repo. Good luck!
ChakraCore has supported WebAssembly since v1.4, and node-chakracore has supported it via JavaScript since 8.x:
https://github.com/sass/node-sass/pull/1777#discussion_r127280773