Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2014-12-31 09:11:01 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-12-31 12:08:01 +0300
commit5f8482e1eed7c22f51e08db52abe2d4358f04b9a (patch)
treef2373009bab948af058b99a158fc20e59d3a9414
parent748afb40d5becf6ad0b1f67c59f0a0c9a172b989 (diff)
remove unused code/modules
-rwxr-xr-xbin/cmd.js12
-rw-r--r--index.js12
-rw-r--r--package.json1
3 files changed, 6 insertions, 19 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 124e8c7..d3df10a 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -53,7 +53,7 @@ var argv = minimist(process.argv.slice(2), {
if (argv.version) {
console.log(require('../package.json').version)
- return done()
+ done()
}
var torrentId = argv._[0]
@@ -98,7 +98,7 @@ if (argv.help || !torrentId) {
Please report bugs! https://github.com/feross/webtorrent/issues
*/}.toString().split(/\n/).slice(1, -1).join('\n'))
- return done()
+ done()
}
if (process.env.DEBUG || argv.stdout) {
@@ -375,13 +375,13 @@ function onReady () {
linesremaining -= 8
var pieces = torrent.storage.pieces
- for(var i = 0; i < pieces.length; i++) {
+ for (var i = 0; i < pieces.length; i++) {
var piece = pieces[i]
if (piece.verified || piece.blocksWritten === 0) {
continue;
}
var bar = ''
- for(var j = 0; j < piece.blocks.length; j++) {
+ for (var j = 0; j < piece.blocks.length; j++) {
bar += piece.blocks[j] ? '{green:█}' : '{red:█}';
}
clivas.line('{4+cyan:' + i + '} ' + bar);
@@ -395,7 +395,7 @@ function onReady () {
if (torrent.parsedTorrent) {
var bits = 0
var piececount = Math.ceil(torrent.parsedTorrent.length / torrent.parsedTorrent.pieceLength)
- for(var i = 0; i < piececount; i++) {
+ for (var i = 0; i < piececount; i++) {
if (wire.peerPieces.get(i)) {
bits++
}
@@ -404,7 +404,7 @@ function onReady () {
}
var tags = []
if (wire.peerChoking) tags.push('choked')
- var reqStats = wire.requests.map(function(req) {
+ var reqStats = wire.requests.map(function (req) {
return req.piece;
})
clivas.line(
diff --git a/index.js b/index.js
index 2ea0b4f..4a62766 100644
--- a/index.js
+++ b/index.js
@@ -8,15 +8,12 @@ var debug = require('debug')('webtorrent')
var DHT = require('bittorrent-dht/client') // browser exclude
var EventEmitter = require('events').EventEmitter
var extend = require('extend.js')
-var FileReadStream = require('filestream/read')
-var fs = require('fs')
var hat = require('hat')
var inherits = require('inherits')
var loadIPSet = require('load-ip-set') // browser exclude
var parallel = require('run-parallel')
var parseTorrent = require('parse-torrent')
var speedometer = require('speedometer')
-var stream = require('stream')
var zeroFill = require('zero-fill')
var FSStorage = require('./lib/fs-storage') // browser exclude
@@ -250,12 +247,3 @@ WebTorrent.prototype.destroy = function (cb) {
parallel(tasks, cb)
}
-
-/**
- * Check if `obj` is a W3C Blob object (which is the superclass of W3C File).
- * @param {*} obj
- * @return {boolean}
- */
-function isBlob (obj) {
- return typeof Blob !== 'undefined' && obj instanceof Blob
-}
diff --git a/package.json b/package.json
index 9931f29..7c18ea0 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,6 @@
"dezalgo": "^1.0.1",
"end-of-stream": "^1.0.0",
"extend.js": "^0.0.2",
- "filestream": "^2.1.0",
"git-sha1": "^0.1.2",
"hat": "0.0.3",
"inherits": "^2.0.1",