On Jun 10, 02014, at 5:48, Alexey Petrushin <[email protected]> wrote:
> Hi, I'd like to provide administrative app with a page when you can see live > logs. To do so I need to execute `tail -f app.log | grep error` and get the > output chunk by chunk (streaming) as it get added to log file. But the > problem is: > > 1. child_process.exec doesn't have streaming, it return only when the child > process is terminated > 2. child_process.spawn does have streaming, but it can execute only commands, > it can't execute complex expressions like `tail -f app.log | grep error` > > Is there an easy way to solve it? Why not tail yourself — fs.createReadStream, and pipe it through a filter in javascript?
signature.asc
Description: Message signed with OpenPGP using GPGMail
