diff --git a/lib/protocol/SFTP.js b/lib/protocol/SFTP.js index a7fc4f90..96c2c325 100644 --- a/lib/protocol/SFTP.js +++ b/lib/protocol/SFTP.js @@ -282,12 +282,14 @@ class SFTP extends EventEmitter { end() { this.destroy(); + return this; } destroy() { if (this.outgoing.state === 'open' || this.outgoing.state === 'eof') { this.outgoing.state = 'closing'; this._protocol.channelClose(this.outgoing.id); } + return this; } _init() { this._init = noop;