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

Bytes transfered event in download method #43

Open
@charlietilt

Description

@charlietilt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions