Reliably reading from a FIFO in NodeJS
I'm writing a NodeJS script which interacts with a 3rd party application. The third party application will write data to a file for the duration that it's open. I'd like for my NodeJS application to receive this data in real-time. My script creates a fifo: child_process.spawnSync('mkfifo', [pipePath]); It then launches the 3rd party application using child_process.spawn . Finally, it reads from the pipe. let pipeHandle = await promisify(fs.open)(pipePath, fs.constants.O_RDONLY); let stream = fs.createReadStream(null, {fd: pipeHandle, autoClose: false}); stream.on('data', d => { console.log(d