Not exactly the same. Had I not been actively experimenting with this API I would not have known by reading only Chrome samples repository. I do not know Python, have not tried before this except for once or twice. When I run the same shell script at the terminal I get the correct result each time. Running the code through WebTransport does not produce the same result. If we did not have to run a server, rather direct executable permission on the local machine, that would eliminate the need to start a php or Python server to test, a modern version of Native Messaging. Nonetheless this API is something like what I was trying to describe at
https://bugs.chromium.org/p/chromium/issues/detail?id=1115640, before I know this API existed. It would be interesting to be able to run JavaScript locally, or even a browser instance that runs JavaScript, as the server.
const reader = transport.incomingUnidirectionalStreams.getReader();