This is newly possible with Pandoc 3.9, the first release to officially support WASM.
Thank you for sharing.