Hello Suraj,
I suspect that you have been using child_process.exec(). Look into
child_process.spawn()<http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options>
.
It returns an EventEmitter and allows you to add stdout, stderr and exit
listeners that will be called asynchronously. Here is an excerpt from the
node.js doc on how to use spawn():
var spawn = require('child_process').spawn,
ls = spawn('ls', ['-lh', '/usr']);
ls.stdout.on('data', function (data) {
console.log('stdout: ' + data);});
ls.stderr.on('data', function (data) {
console.log('stderr: ' + data);});
ls.on('exit', function (code) {
console.log('child process exited with code ' + code);});
On Friday, February 8, 2013 6:01:30 PM UTC-8, Suraj Singh Thapa wrote:
>
> Hi,
>
> * I have been exploring Node, Express and chiild_process since last few
> days. I have a static module with data (some array) which now I know how to
> show it to index page.
>
> * I can launch linux command and gets its output/error using
> chile_process.
>
> Now I need to know, How can I constantly(Not to wait for process to
> finish) get STDOUT of of command and pass it to index page.
>
> Any, suggestion would be helpful for beginners like me.
>
> Cheers,
>
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.