Any idea/tips on how to implement *a real time-esh update feature* similar 
to linux TOP command in Node.JS?

My implementation is something like the following:

fs.watchFile(filepath, someFunction);

someFunction(curr, prev){
  // Create a child process and run tail command 'tail -f path/to/file'
  // Let tail.stdout listen to data event and inside it
      process.stdout.write('\033c'); // Reset Terminal every time on file change
      process.stdout.write(data);}

Is there any better implementation or package that could assist in 
implementing this feature? Since watchFile() is slow.

Please note that fs.watch() works only one time, then it never make any 
callbacks/triggers on file change.

Thanks in advance!

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/d85bcb17-1d1f-4365-acc9-58d8ccd8508c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to