from emscripten official docs
# Get the emsdk repo
git clone https://github.com/emscripten-core/emsdk.git
# Enter that directory
cd emsdk
# Download and install the latest SDK tools.
./emsdk install latest
# Make the "latest" SDK "active" for the current user. (writes .emscripten file)
./emsdk activate latest
# Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh
Check that installation is correct and emcc is in your path
which emcc
should show the path where its installed /usr/lib/emscripten/emcc
in my case
pip3 install hvcc
In the folder of your patch patch.pd for example run:
hvcc patch.pd -n sine_test -o sine_test -g js
where :
-n its the name
-o its the output name for the folder
-g its the export target
refer to the docs for knowing more
use your favourite http server to serve the files go to the js folder
cd sine_test
cd js
python3 -m http.server
navigate to localhost:8000 on your browser and there you go
follow the instructions given by emscripten to add emsdk PATH permanently to your system