doc/contributing/maintaining/maintaining-web-assembly.md
Support for WebAssembly has been identified as one of the top technical priorities for the future success of Node.js.
This document provides an overview of our high-level strategy for supporting WebAssembly and information about our current implementation as a starting point for contributors.
The key elements of our WebAssembly strategy include:
Node.js gets its core WebAssembly support through V8. We don't need to do anything specific to support this, all we have to do is keep the version of V8 as up-to-date as possible.
As a runtime, Node.js must implement a number of APIs in addition to the core WebAssembly support in order to be a good choice to run WebAssembly. The project has currently identified these additional APIs as important:
The most important thing we can do on this front is to either find and reference resources or provide resources on how to:
It is also important to support and track the ongoing work in ESM to enable loading of WebAssembly with ESM.
Use cases for which Node.js will be a good runtime will include code both in JavaScript and compiled into WebAssembly. It is important that Node.js APIs are able to be called from WebAssembly in an efficient manner without extra buffer copies. We need to:
The Node.js WASI implementation is maintained in the uvwasi repository in the Node.js GitHub organization. As needed, an updated copy is vendored into the Node.js deps in deps/uvwasi.
In addition to the code from uvwasi, Node.js includes bindings and APIs that allow WebAssembly to be run with WASI support from Node.js. The documentation for this API is in WebAssembly System Interface (WASI).
The implementation of the bindings and the public API is in: