-
Notifications
You must be signed in to change notification settings - Fork 298
Closed
Description
I have this question on SO:
https://stackoverflow.com/questions/56945909/combine-fs-createreadstream-with-process-stdin-stream
Basically I am continually writing to a file to keep track of old data.
At some point, I want to read the data from the file and then start reading the new data from stdin. I don't want to duplicate data nor do I want to lose data.
Is there some reliable way to do this?
process.stdin.resume().pipe(fs.createWriteStream('file'));
{
// much later on
const sws = new SomeWriteStream({end:false});
fs.createReadStream('file').pipe(sws).once('end', () => {
process.stdin.pipe(sws);
});
}
Metadata
Metadata
Assignees
Labels
No labels