Skip to content

Interface: TransferOptions ​

Options for ScpClient.upload and ScpClient.download.

Properties ​

PropertyTypeDescription
concurrency?numberMaximum files transferred in parallel for directory copies. SFTP only, SCP streams one file at a time over a single channel. Defaults to 4.
filter?(path, entry) => booleanDecides whether an entry is copied. path is relative to the transfer root and uses /. Returning false for a directory skips the whole subtree. Symlinks are followed and other entries such as sockets are skipped, so the filter only sees files and directories.
onProgress?(progress) => voidCalled whenever bytes move.
preserve?booleanKeep modification and access times and the full mode, including setuid, setgid and sticky bits, also on files that already exist, like scp -p. Without it new files still get the source's permission bits, reduced by the umask, and existing files keep their mode.
recursive?booleanRequired to copy directories, like scp -r.
signal?AbortSignalCancels the transfer. Files already in flight over SFTP finish in the background.

Released under the MIT License.