Skip to content

Instantly share code, notes, and snippets.

@summer4096
Created October 17, 2015 18:23
Show Gist options
  • Save summer4096/3d009a4dd49c758d3d6d to your computer and use it in GitHub Desktop.
Save summer4096/3d009a4dd49c758d3d6d to your computer and use it in GitHub Desktop.
import WebTorrent from 'webtorrent'
let client = new WebTorrent()
let uri = 'http://releases.ubuntu.com/15.04/ubuntu-15.04-desktop-amd64.iso.torrent'
client.add(uri, torrent => {
console.log('Client is downloading:', torrent.infoHash)
for (let file of torrent.files) {
console.log(file)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment