Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Bytes transfered event in download method #43

Open
charlietilt opened this issue Aug 27, 2015 · 0 comments
Open

Bytes transfered event in download method #43

charlietilt opened this issue Aug 27, 2015 · 0 comments

Comments

@charlietilt
Copy link

Not sure if there is anyway to do this currently and if so let me know.
I am looking for a way to setup a listener on the client to capture, on an interval, the progress of the file being downloaded.

Example:

client = new Scp2.Client config
    client.on 'transfer', (bytes) ->
      Logger.verbose "Bytes transfered (#{localFile}): #{bytes}"
    client.download remoteFile, localFile, (error) ->
      callback error, localFile

The only place that the 'transfer' event is currently emitted is in the Client.write method.

I made a Gist with some minor updates to Client.prototype.download to emit this.
Any comments/thoughts?
https://gist.github.com/charlietilt/8d6c64b50ebf688b47e1

dbaikov added a commit to ReflexionMed/node-scp2 that referenced this issue Feb 28, 2016
This changes allows to monitor file transfer progress

related issues spmjs#43 spmjs#57
dbaikov added a commit to ReflexionMed/node-scp2 that referenced this issue Feb 28, 2016
This changes allows to monitor file transfer progress

related issues spmjs#43 spmjs#57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant