Skip to content

hatappo/wasm-part-of-modern-frontend-development

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modern Frontend Development with Node.js

の第10章 Integrating Native Code with WebAssembly のコードを試したものです。

November 2022 の出版ですが、既に古くなっている箇所があるように思います。 動かすためにサンプルコードを少し修正する必要がありました。

ポイント

  • asconfig.json"extends": "./node_modules/@assemblyscript/wasi-shim/asconfig.json", を追加する

コマンド

# インストール
npm install

# コンパイル
npx asc assembly/index.ts -o echo.wasm --use abort=wasi_abort --debug

# 実行
node --experimental-wasi-unstable-preview1 --no-warnings app.mjs ワールド
#=> Hello ワールド!

参考