So I realized I added a pretty terrible bug with my last PR (all uploaded files go to the root of the remote server, ignores destination). So I wanted to fix that, but I kind of got carried away. So I...
moved all the Makefile logic to package.json (standard node practice)
updated all used npm deps to the latest
replaced jscoverage (ahd security warnings) with nyc (standard)
added e2e tests for a few of the main methods using a mock local server
based that server on the sftp example in the ssh2 repo, along with parts of the README
runs on port 2222, tears down and spins up separately for each test
fixed the bug I introduced by adding back the logic to write to a given directory with the source filename, and passed in either that desintation or the given one to the scp method
replaced the password prompts with the npm prompt package, so passwords can be hidden
I also wanted to replace jshint with prettier (much smaller footprint when deving, and prettier is pretty standard at this point), add some coverage thresholds, and maybe beef up the local server so it actually writes files so all that logic can be checked, but that's for another day I guess.
Sorry for the massive PR, let me know if you'd like anything changed!
Hello again!
So I realized I added a pretty terrible bug with my last PR (all uploaded files go to the root of the remote server, ignores destination). So I wanted to fix that, but I kind of got carried away. So I...
prompt
package, so passwords can be hiddenI also wanted to replace jshint with prettier (much smaller footprint when deving, and prettier is pretty standard at this point), add some coverage thresholds, and maybe beef up the local server so it actually writes files so all that logic can be checked, but that's for another day I guess.
Sorry for the massive PR, let me know if you'd like anything changed!