sshp Rewrite from JavaScript to C
Posted by Dave Eddy on May 20 2021 - tags: techIn 2013, I wrote a program in Node.js called sshp. This was right
around the time I was investing heavily into learning node, and
honestly having a blast doing it. Node is quick and fun to write, and with
only a couple hundred lines of code, I was able to write node-sshp.
node-sshp is a command line utility that acts as a parallelizer for ssh.
It works by taking in a file containing a list of hosts to connect to and
looping over each host firing off an ssh command in parallel (with a
configurable maximum number of concurrent processes). The tool’s description
is:
sshpmanages multiple ssh processes and handles coalescing the output to the terminal. By default,sshpwill read a file of newline-separated hostnames or IPs and fork ssh subprocesses for them, redirecting the stdout and stderr streams of the child line-by-line to stdout ofsshpitself.
Writing this tool in Node was an obvious choice at the time: the company I was working for was using Node heavily, and this tool was written specifically to be used at my job. Managing multiple concurrent child processes and IO streams also made Node the obvious choice.





