I have this:
const p = path.resolve(projectRoot + '/NAMEDPIPEIN');
const fd = fs.openSync(p, 'r+');
fs.createReadStream(null, {fd}).on('data', function (d) {
if (String(d).trim() === '[stdin end]') {
return process.nextTick(cb);
}
process.argv.push(String(d).trim());
});
I start the Node.js process, and then later, I write to the named pipe. For some reason no data seems to be arriving in the on data callback.
I am writing to named pipe like so:
mkfifo NAMEDPIPEIN
echo "foo bar baz" > NAMEDPIPEIN