Skip to content

Releases: theophilusx/ssh2-sftp-client

Documentation fix Mk2

22 Jan 11:36
Compare
Choose a tag to compare

Restore missing README.md file

Typo fix in packagte.json

22 Jan 07:54
Compare
Choose a tag to compare

Just a stupid fat finger error fix!

Minor documentation update

22 Jan 07:43
Compare
Choose a tag to compare

Minor update to documentation to add links to allow supporters to donate to the project to help with on-going maintenance and support.

Bug fix and security update

19 Jan 03:22
Compare
Choose a tag to compare
  • Bump to depend on ssh2 1.15.0, which has the fix for CVE-2023-48795
  • Add new promiseLimit setting to limit the number of concurrent promises used by downloadDir/uploadDir. Default is set to 10. Testing indicated for most situations, increasing much above 10 had little benefit and eventually, once number was large enough, actually degraded performance as node would spend more time context switching than data transferring.
  • Some minor code clenup and added quite a few new tests
  • Changed minimum supported node version. While testing with v16.20.2 still appears to work, it is HIGHLY recommended that at least node 18.18.2 is used. Bottom line, if you log an issue, you need to be on node >= v18.

Maintenance Release

02 May 23:22
Compare
Choose a tag to compare
  • Re-factoring of some methods to enable them to better catch network errors within surrounding promise.
  • Fix error in handling options in some methods which prevented setting file permissions
  • Added additional tests and test coverage

Minor bug fix release

04 Sep 21:41
Compare
Choose a tag to compare
  • Fixes an issue with module hanging and failing to return any error when a corrupted private key was supplied. Now returns an error that the module was unable to parse the private key.

Minor bug fix release

04 Aug 06:17
Compare
Choose a tag to compare

Fix two minor bugs

  • Sometimes, when initialisation of sftp sub-system failed, the module would attempt to call sftp.end(), which would fail with an undefined reference error

  • When calling the get() method and supplying a destination stream for the data, if the soruce file did not exist on the remote server, the destination stream was not closed and could result in a resource leak.

Minor bug fixes

14 Jul 02:20
Compare
Choose a tag to compare

A couple of fairly minor changes to address some edge case issues

  • DOn't throw error or reject promise if end() method called when there is no active sftp connection. If end() is called and there is no active connection, just turn into a noop. Better to call end() when not needed than miss calling it because it might cause an error in some scenarios.
  • Don't throw exception or reject a promise when an 'unexpected' end or close event is seen. Logic for determining when a close or end event was 'unexpected' was not reliable enough. Besides, trying to identify unexpected close/end signals didn't really add any value. Now if a close or end signal occurs which was not 'expected', we will just log it. We do invalidate the sftp connection whenever we see an end/close event regardless.
  • Now use nullish coalescing instead of or'iing to set the various params for retry configuration. Previously, using or'ing meant you couldn't set a param to 0. Using ?? now allows this.
  • Made some minor changes to when the flags used to track event handling are reset. Previously, they were reset after temporary listeners were removed. We now do the reset after new temporary listeners are added.

None of the above changes are API breaking (for v9). Should be able to upgrade from any previous 9.x version with no issue.

Minor bug fix

21 Jun 01:55
Compare
Choose a tag to compare

Minor bug fix version

The get() method was not always returning a buffer when no destination argument was supplied due to a race condition between concat-stream and readStream finish event. When triggered, get() would return the concat-stream object instead of the buffer object it contains.

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.