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 up[CLOSED] Is it possible to save the file using the stream? #109
Comments
This comment has been minimized.
This comment has been minimized.
|
The When it's ready, this is how you would use it: var fs = require('fs')
file.createReadStream()
.pipe(fs.createWriteStream('~/downloads/movie.mp4'))
.on('close', function () { console.log('done!') }) |
This comment has been minimized.
This comment has been minimized.
|
Very cool, excited to try it out. |
This comment has been minimized.
This comment has been minimized.
|
This should be working now using feross' code sample. |
This comment has been minimized.
This comment has been minimized.
|
Tried it out, works great. Thanks. One thing though, I noticed that it is significantly slow downloading files ( I compared the same file to using something like vuse or utorrent). Is that because of the protocol the torrent client is built on or just certain features such as port forwarding,upnp, etc haven't been added in yet? |
This comment has been minimized.
This comment has been minimized.
|
It could be any number of reasons depending on the torrent. Vuze/uTorrent are significantly more mature than webtorrent. Would you mind including your relative speeds for Vuze vs webtorrent and a link to the torrent? (e.g. using the webtorrent executable) |
This comment has been minimized.
This comment has been minimized.
|
User's issue (saving file as a stream) is fixed now. Closing. |
Wednesday May 14, 2014 at 18:35 GMT
Originally opened as https://github.com/feross/bittorrent-client/issues/13
Hey I'm new to node and not very familiar with streams. I'm trying out your code and I can see that you can use
var stream = file.createReadStream()
To get a stream of the file but what if I just want to download the whole file and save it on my computer. Is it possible to do that?