I have hit a bit of a road block and i am wondering if anyone can help me out.
I am trying to use ".pipe()" to redirect a file to the stdin of a spawned process
so if anyone knows how to correctly pipe a stream made with createReadStream into the stdin of a process created with spawn i would love a a little example code :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