Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHow to get progress of a download #381
Comments
This comment has been minimized.
This comment has been minimized.
|
In addition, running node v0.10.38, I get a ton of:
and then finally:
This is using the same example. |
This comment has been minimized.
This comment has been minimized.
|
We worked on a webtorrent based project over the weekend, and here is the file where we calculated speed and progress. It's also really helpful to look through the instant.io source code to find a lot of these things. |
This comment has been minimized.
This comment has been minimized.
|
@webchaz The node warning you're seeing is a node 0.10 bug. If you upgrade to node 0.12 or iojs, the warning should go away. See: nodejs/node-v0.x-archive#6065 @ericwooley's advice is right. For now, it's really useful to look at the code for https://instant.io to learn how to do various things. Please send PRs to improve the docs, if you find things that aren't documented. Specifically, here's how to get download progress: https://github.com/feross/instant.io/blob/0bfc78b401ae39bcd3352c8c7cb6f5d5c1bc5e0b/client/index.js#L144 |
This comment has been minimized.
This comment has been minimized.
|
@feross Are you open to a PR |
This comment has been minimized.
This comment has been minimized.
|
@feross @ericwooley Thanks for the links and info, this was exactly what I was looking for. |
This comment has been minimized.
This comment has been minimized.
|
I'd accept a PR to add
|
This comment has been minimized.
This comment has been minimized.
|
@feross I didn't notice the swarm speeds were implemented. That makes things easy! |
I started with the example provided here for node: https://github.com/feross/webtorrent/blob/master/examples/browser-download.js
I can't see a way to get the download progress (speed, percent left, etc.). Is there an event for this?