10 WebAssembly modules in Node.js
This chapter covers:
- Loading a WebAssembly module using Emscripten’s generated JavaScript code
- Using the WebAssembly JavaScript API to load a WebAssembly module
- Working with WebAssembly modules that call into JavaScript directly
- Working with WebAssembly modules that use function pointers to call into JavaScript
In this chapter you’ll learn how to use WebAssembly modules in Node.js. With Node.js, there are some differences compared with a browser, like there being no graphical user interface. There are a lot of similarities between the JavaScript needed in a browser and in Node.js when working with WebAssembly modules. Even with the similarities, however, it’s recommended that you test your WebAssembly module in Node.js to verify that it works as expected on the versions of Node.js that you want to support.
Node.JS
Node.js is a JavaScript runtime built on the V8 engine that is the same engine that also powers the Chrome web browser. Node.js allows for JavaScript to be used as server-side code. It also has a large number of open-source packages available to help with many programming needs. For a book dedicated to teaching you about Node.js, Manning, see Node.js in Action, Second Edition: https://www.manning.com/books/node-js-in-action-second-edition