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:
authorfisch0920 <fisch0920@gmail.com>2014-05-16 12:43:18 +0400
committerfisch0920 <fisch0920@gmail.com>2014-05-16 12:43:18 +0400
commitda72f6bbe213f98575e1bf01f6cd17ee331bcf53 (patch)
treeac66940f4ddb11fa38d5427a79f3209f4f12a761 /index.js
parent1529dcff555bba3abe9a67e93d030548fdb8863f (diff)
adding FSStorage; webtorrent now can save the results of a torrent download to the filesystem
Diffstat (limited to 'index.js')
-rw-r--r--index.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/index.js b/index.js
index 3a6b7ef..2e6fe56 100644
--- a/index.js
+++ b/index.js
@@ -3,6 +3,7 @@
module.exports = WebTorrent
var Client = require('bittorrent-client')
+var FSStorage = require('./lib/fs_storage')
var fs = require('fs')
var url = require('url')
var http = require('http')
@@ -10,6 +11,7 @@ var inherits = require('inherits')
var pump = require('pump')
var mime = require('mime')
var rangeParser = require('range-parser')
+var extend = require('extend.js')
inherits(WebTorrent, Client)
@@ -43,6 +45,9 @@ WebTorrent.prototype.add = function (torrentId, opts, cb) {
opts = {}
}
if (typeof cb !== 'function') cb = function () {}
+ opts = extend({
+ storage: FSStorage
+ }, opts)
self.index = opts.index