At least in theory you should be able to compile an existing FBP system to wasm, especially now that all major browsers and Node.js support WebAssembly. However, the downsides are the pretty hefty performance penalty of invoking wasm functions, and the difficulty of non-trivial interactions between WebAssembly and JS. Both of these are likely to see improvements once WebAssembly gets more mileage.
If you want to do FBP in JavaScript right now, the most pragmatic option is using NoFlo (
https://noflojs.org). NoFlo works in both browsers and Node.js, and has years of production usage behind it. The new functionality shipped in 0.8, and the removal of deprecated old APIs in the upcoming 1.x release bring it a lot closer to "classical" FBP.
Another server-side JavaScript FBP option is MsgFlo where each FBP node is represented by its own process (Node.js, Python, Rust, Arduino, whatever). But this of course involves a bit more setup than just "npm install". The msgflo-project template gives a good starting point, and ready-made Docker configuration to get it going:
https://github.com/msgflo/msgflo-project
/Henri