jeanbmar / s3-sync-client

AWS CLI s3 sync command for Node.js
MIT License
83 stars 22 forks source link

Emit 'start', 'done', and 'error' events for downloaded objects. #44

Open mikenikles opened 1 year ago

mikenikles commented 1 year ago

Relates to #39.

This PR emits the following events:

Each event payload contains an object with:

Note: #39 also asks for ignore events. This PR does not include that. Happy to add that, but I would need some pointers as to where the best place for that is.

jeanbmar commented 1 year ago

Thank you for submitting a PR! Sounds like a great addition, I'll review it asap.

jeanbmar commented 1 year ago

Sorry for the late reply, I wanted to finish the ts migration before reviewing the PR.

In order to support the events, we need to have them for the following operations:

If we are implementing an event for ignored objects, it needs to be emitted in:

We should probably change the naming a bit to avoid possible confusion between global transfer events and object events (e.g. start: objectStart)

Implementation is not hard from a technical perspective, but changes happen in a lot of commands. If you are still up to work on this that's great, else I can make the changes, let me know :).

Thanks!

mikenikles commented 1 year ago

No problem, I just caught up on the changes you've made and am excited to give the newest version a go! Looking at your detailed explanation, I believe you'd be much quicker to apply these changes given your familiarity with the code.

Having said that, do let me know when you have it ready for testing and I can test it. Your library is a core piece to how the https://indexed.xyz CLI works, so thank you for keeping it maintained 😍!