Created
October 31, 2011 20:56
-
-
Save levidehaan/1328912 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using child_processes, if i create a new process, | |
ssh = spawn('ssh', ['[email protected]']); | |
and then put a listener on stdout | |
ssh.stdout.on('data', function(data){ | |
console.log(data); | |
}); | |
and then send some stuff | |
ssh.stdin.write("ls -alh\n"); | |
and | |
ssh.stdin.write("touch testing.txt\n"); | |
and then toss another listener on, but this time a one time listener | |
ssh.stdout.once('data', function(data){ | |
console.log(data); | |
} | |
it starts over at the begining of the socket output, instead of the next emit from stdout | |
so it essentially instantly outputs, because its grabbing existing data from stdout | |
is there a way to start it at the end of the socket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment