
Use nullish coalescing when setting retry parameters instead of or'ing with defaults.It does no harm to call end() when there is no connection, so no need to raise an error. Don't throw an error when calling end() if there is no active SFTP connection.Now they are reset after a new set of temporary listeners are added. Changed when event handled flags are reset.Both these handlers will now invalidate the SFTP connection object and log that the event fired and nothing else. However, classification of events as being unexpected was unreliable and didn't add much real value. Previously, an end or close event would cause an error to be raised or a promise to be rejected if the event was deemed to be unexpected. Change the default end and close handlers not to throw error or reject promises.If the remote file did not exist, the method would return an error, but failed to close any passed in stream supplied as the destination for the data in the get() call.

Fix bug in get() method where supplied destination streams were not close, creating a possible resource leak.This could lead to undefined reference errors. Fix bug in end() method where it was possible for the module to attempt calling the underlying ssh2 end() method when ssh2 has not been initialised.Now reports that it was unable to parse the private key. The method was not handling errors fro corrupted ssh private keys and would hang indefinitely without reporting any error. Fix bug in connect() method when private key data was corrupted.Not returning the promise in a then() blockĪn SFTP client for node.js, a wrapper around SSH2 which provides a high level convenience abstraction as well as a Promise based API.ĭocumentation on the methods and available options in the underlying modules can be found on the SSH2 project pages.Ĭode has been tested against Node versions 14.20.0, 16.17.2 and 18.8.0.Connection hangs or fails for larger files.Timeout while waiting for handshake or handshake errors.How can I connect through a Socks Proxy.How can I upload files without having to specify a password?.How can I pass writeable stream as dst for get method?.Remote server drops connections with only an end event.Issues with fastPut() and fastGet() Methods.createWriteStream(remotePath, options) => stream object.createReadStream(remotePath, options)) => stream object.downloadDir(srcDir, dstDir, options) => string.uploadDir(srcDir, dstDir, options) => string.posixRename(fromPath, toPath) => string.append(input, remotePath, options) => string.fastPut(localPath, remotePath, options) => string.put(src, remotePath, options) => string.fastGet(remotePath, localPath, options) => string.

