Wasm 实例阶段导入


【Wasm Instance Phase Imports】

稳定性: 1.1 - 处于活跃开发中

实例导入允许将任何 .wasm 文件像普通模块一样导入,从而支持它们的模块导入。

【Instance imports allow any .wasm files to be imported as normal modules, supporting their module imports in turn.】

例如,一个包含以下内容的 index.js

【For example, an index.js containing:】

import * as M from './library.wasm';
console.log(M); 

在以下条件下执行:

【executed under:】

node index.mjs 

将为 library.wasm 的实例化提供导出接口。

【would provide the exports interface for the instantiation of library.wasm.】