Skip to content

Releases: theophilusx/ssh2-sftp-client

Major Release - New methods, API updates

14 Jun 03:16
Compare
Choose a tag to compare

This is a major new version which includes both new methods and API changes as well as some code cleanup and refactoring to improve performance.

  • API Changes

    • list() method now accepts a filter function instead of a regular expression to filter the list of items returned.
    • Ability to set autoClose in options passed into get() and put() methods has been removed. Tis option caused confusion for developers and made the logic overly complicated for rare use cases. You can not just use the new createReadStream() and createWriteStream() when you want low level control.
    • Ability to set 'end' property in pipe() operations used by get() and put() methods has been removed because it complicated the logic of get() and put() methods when only useful for a very small number of edge cases. Use getReadStream and getWriteStream and manage pipe() manually should you require this type of low level control
    • The 3rd argument to uploadDir() and downloadDir() methods has been changed. Previously, this argument was a filter function. It is now an object which can have properties of 'filter', to supply a filter function and useFastGet/useFastPut, a boolean used to tell the method to use the potentially faster fastGet() or fastPut() method to transfer data.
  • New Methods

    • createReadStream(): returns a read stream connected to a remote file on the sftp server
    • createWriteStream(): returns a write stream connected to a remote file on the sftp server
    • rcopy(): create a remote copy of a remote file on the sftp server
  • Other Changes

    • downloadDi()/uploadDir() now uses asynchronous calls to transfer files to help improve speed
    • The retry code used to retry making a connection after initial failure has been refactored and improved to more reliably handle retry options.
    • Management of temporary event listeners has been refactored to make management of event listeners when using internal calls to various methods more efficient.

Although not benchmarked, the performance of this version appears to be significantly better than previous versions. Running the test suite completes much faster, despite quite a new new tests being added for the new methods.

Minor update

17 May 08:41
Compare
Choose a tag to compare
  • Add longname property to description of each file in list() call
  • Change rmdir() to only do asynchronous processes on file deletion. Directory deletion done synchronously.
  • Bump ssh2 dependency version to 1.10.0

Major release with some breaking changes

05 Apr 05:10
Compare
Choose a tag to compare

This release changes the API for the uploadDir() and downloadDir() methods. This is a breaking change. Previously, these methods accepted an optional 3rd argument, a regular expression used to filter which files and directories would be included in the transfer. This argument has now been changed to be an optional predicate filter function. The function will be called for each file or directory in the tree specified as the 1st argument and should return true if the target should be included in the transfer, false to exclude it. See README for full details.

The rmdir() method has been refactored to better exploit asynchronous processing of directory tree removal. For broad shallow directory trees, significant performance improvements have been observed. The rmdir() API has not changed.

Bumped the ssh2 dependency to v1.9.0

Minor bug fix and version bump

26 Mar 05:07
Compare
Choose a tag to compare

Bump to ssh2 v1.8.0

Change uploadDir/downloadDir to use put() and get() instead of fastPut() and fastGet() becuase the latter are not supported by all sftp servers.

Bump ssh2 dependency to 1.6.0 plus removeTempListeners bug fix

31 Jan 07:33
Compare
Choose a tag to compare

This release bumps the ssh2 dependency to 1.6.0, which includes some bug fixes for issues affecting sftp.

This release also fixes a bug in removeTempListeners() where it was using the old data structure for tracking temporary listeners rather than the new structure introduced in 7.2.1

Minor bugfix release

19 Dec 21:44
Compare
Choose a tag to compare

Fix a bug in get() requests which occurs when using slower destination devices for retrieved files. In some circumstances, attempting to access a downloaded file immediately after download would result in errors because file contents had not yet been fully flushed and stream cleaned up. The fix was to change the event used to resolve the get() promise to use the finish signal on the write stream rather than on the read stream. Previous version used the read stream signal because in some use cases, the client code does not want to close the write stream. Fix now looks to see what options have been passed in to get() and will use the write stream events when it can and only use the read stream events when this is not possible. This could still result in errors when the client has decided to explicitly manage the write stream, but in that case, it is also down to the responsibility of the client not to attempt to access the downloaded data until they have cleaned up the streams correctly.

Bugfix release

06 Dec 01:53
Compare
Choose a tag to compare
  • Fix problem with ssh connections not being correctly closed and released when sftp channel creation fails.
  • Fix problem with global tracking of temporary listeners and some listeners being removed too early when function calls other function provided by the library
  • Add additional check in mkdir to increase efficiency of mkdir calls in general case
  • Bump versions of development libraries

While this version does not change the API, as it does represent fundamental change to the way temporary event listeners are managed, it is being released as a new minor version rather than just a new patch version.

Update to ssh2 1.5.0, fix put stream option handling

14 Oct 22:53
Compare
Choose a tag to compare

This version bumps the ssh2 dependency to 1.5.0.

This version also changes the handling of options passed into put() for the internal write stream used to create the remote file. It is now no longer possible to set the write stream to autoClose: false. This caused a RCE problem because the promise was resolved on finish rather than close, which could result in false 'file not found' errors. As autoClose: false is of little benefit for this internal write stream and as there is no easy way to manually close the stream when autoClose is false, having this ability causes more problems than it solves. Now, any setting of autoClose on the write stream will be ignored (it is always autoClose: true). As this is an interface change, bumping to v7.1.0

Update to use new ssh2 version 1.4.0.

08 Sep 01:37
Compare
Choose a tag to compare

Update to ssh2 v1.4.0

Minor fix in tests for local resources to make more consistent across platforms.

Minor bug fix

19 Aug 00:56
Compare
Choose a tag to compare

Fix typo in handling stream closure for put() method.