Skip to content

How node-scp compares ​

There are good SSH file transfer libraries for Node.js. This page tries to be fair about when each one is the better choice. Numbers were checked in September 2026.

node-scp 1.xssh2-sftp-client 12.xnode-ssh 13.xscp2 0.5
Weekly downloadsabout 25 thousandabout 3.1 millionabout 450 thousandabout 13 thousand
Last release2026202620252016, unmaintained
SFTPyesyesyesyes
SCP protocol (servers without SFTP)yesnonono, despite the name
Automatic SFTP / SCP choiceyesnonono
Run remote commandsthrough client.sshnoyes, a main featureno
Remote file operationscommon ones in client.fs, the rest through client.sftpthe richest APIa fewmkdir only
Parallel directory transfersyesyesyesno
Progress, filter, AbortSignalall threeprogress and filterprogress per file, filterevents only
Error codes independent of protocolyespartlynono
TypeScript typesbundledseparate @types packagebundlednone
ES modules and CommonJSbothCommonJSCommonJSCommonJS
CLI and GitHub Actionyesnonono

Pick ssh2-sftp-client when ​

  • you only talk to regular servers with SFTP,
  • you need its broad SFTP surface (streams to remote files, rcopy, append, extended stat handling) and its years of production use,
  • you want the most widely used option.

Pick node-ssh when ​

  • running commands is the main job and file copies are a side task,
  • you want one object for execCommand, putFiles and getDirectory.

Pick node-scp when ​

  • some of your targets are routers, embedded devices, network gear or minimal systems where SFTP is missing,
  • you copy many small files and care about speed (see below),
  • you want protocol independent error codes, cancellation and progress for whole trees,
  • you want the same tool as a library, a CLI and a GitHub Action,
  • you are on scp2 and need a maintained replacement.

About the benchmark numbers ​

node-scp shows a large lead for many small files:

200 files of 4 KiB in 10 directories (lower is better)
node-scp (SFTP)
52 ms
node-scp (SCP)
67 ms
node-ssh
484 ms
ssh2-sftp-client
534 ms
One 16 MiB file (lower is better)
node-scp (SCP)
53 ms
node-scp (SFTP)
57 ms
ssh2-sftp-client
94 ms
node-ssh
104 ms

Most of it comes from one setting: node-scp turns on TCP_NODELAY for the SSH socket, while the others leave Nagle's algorithm on. You can get much of the same improvement with the other libraries by calling setNoDelay(true) on their underlying ssh2 client. For single large files the libraries are close, since all of them use ssh2's pipelined fastPut / fastGet for SFTP.

The benchmarks are in bench/transfer.bench.ts. Before drawing conclusions for your setup, run them against your own server by setting NODE_SCP_BENCH_HOST, NODE_SCP_BENCH_PORT, NODE_SCP_BENCH_USER and NODE_SCP_BENCH_PASSWORD.

Released under the MIT License.