Node.js read stdin synchronous
I tested above async read process.stdin.
in case code, echo 'hello world' | node stdin.js work correct.
but with websocketd --port 8058 ./mock3.js read std empty.
(async function () {
const input = await readStdinSync();
setInterval(() => {
process.stdout.write(JSON.stringify({ now: +new Date(), text: data.trim() }) + '\n');
}, (3000));
})()