If you're using Node.js to SSH into a server, you have a couple of solid options: ssh2 and hivessh. ssh2 has a callback approach that can be unmaintainable and ugly if you use a lot of nested or dependent ssh operations.
Hivessh is an ssh2 wrapper that provides a promise based approach with some nice utilities. like checking if a command exists.
https://github.com/NobleMajo/hivessh https://github.com/mscdex/ssh2