CreateReadStream to join in stdin caviar

I hit a little road block, and I wonder if anyone can help me.

I am trying to use ".pipe ()" to redirect the file to the stdin of the spawned process

so if anyone knows how to correctly pass the stream created using createReadStream to the stdin of the process created using spawn, I would like a small code example: D

function pdf_to_text(f,callback){ var convert = spawn('pdftotext', ['-','-']) f.pipe(convert.stdin) //... do stuff } pdf_to_text(process.stdin,process_log) // this will work just fine pdf_to_text(fs.createReadStream('./test.txt'),process_log) // i can't get this to work for the life of me 
+4
source share

All Articles