Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmcmahen/itty-bitty-torrent
Deprecated -- use something else
https://github.com/bmcmahen/itty-bitty-torrent
Last synced: 18 days ago
JSON representation
Deprecated -- use something else
- Host: GitHub
- URL: https://github.com/bmcmahen/itty-bitty-torrent
- Owner: bmcmahen
- Created: 2013-07-12T21:13:14.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-28T17:34:07.000Z (about 11 years ago)
- Last Synced: 2024-08-01T00:57:03.911Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 152 KB
- Stars: 10
- Watchers: 4
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
node-bittorent
==============A simple bittorrent client extracted from the awesome [peerflix](https://github.com/mafintosh/peerflix), built for Node.
## Install
npm install itty-bitty-torrent
## Example
var Torrent = require('itty-bitty-torrent');
var downloadLocation = __dirname + '/download/';
var torrent = __dirname + '/IAmALegalTorrent.torrent'; // or http URLvar client = new Torrent(torrent, downloadLocation, function(err){
if (!err) client.download();// Get speed
setInterval(function(){
console.log(Math.round(client.speed()) / 1000);
}, 500);// Get percentage downloaded
setInterval(function(){
console.log(Math.round(client.percentage()));
}, 10000);
});client.on('finished', function(){
// The torrent has finished downloading.
});// stop our torrent downloading & seeding
client.stop();## License
MIT