webtorrent / webtorrent-hybrid

WebTorrent (with WebRTC support in Node.js)
https://webtorrent.io
MIT License
519 stars 98 forks source link

Downloading files with folder structure #123

Closed s-bhagwat closed 3 years ago

s-bhagwat commented 3 years ago

It is using file.path for getting path of a file then simply create that directories using fs node module for this I've used two promises one for checking the directory is exist or not another for creating it recursively.

What is the purpose of this pull request? (put an "X" next to item)

[ ] New example X

What changes did you make? (Give an overview) It is a example for downloading torrent files with folder structure same as the torrent.

Which issue (if any) does this pull request address? Current example for downloading files is not creating folder structure and so for larger torrents its harder to manage them so I created this script so files will download in there respected folders.

welcome[bot] commented 3 years ago

🙌 Thanks for opening this pull request! You're awesome.