diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-12-04 05:03:34 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-12-04 05:03:34 +0300 |
commit | be882a41aef365faed42c0f46d12d97c6351b34a (patch) | |
tree | bf9e104538c10951f104019cb74e5c94821c3f6f | |
parent | 7e8f9d233f658f049c64f33203adf20c51ae5493 (diff) | |
parent | b4f2040bbf6968c28bb20367ed895310b8e04fa3 (diff) |
Merge pull request #509 from feross/unused-deps
browser: exclude two unused packages
-rw-r--r-- | lib/torrent.js | 8 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 64d38ff..6d50b5c 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -12,11 +12,11 @@ var FSChunkStore = require('fs-chunk-store') // browser: `memory-chunk-store` var ImmediateChunkStore = require('immediate-chunk-store') var inherits = require('inherits') var MultiStream = require('multistream') -var os = require('os') +var os = require('os') // browser exclude var parallel = require('run-parallel') var parseTorrent = require('parse-torrent') var path = require('path') -var pathExists = require('path-exists') +var pathExists = require('path-exists') // browser exclude var Piece = require('torrent-piece') var pump = require('pump') var randomIterate = require('random-iterate') @@ -42,7 +42,9 @@ var PIPELINE_MAX_DURATION = 1 var RECHOKE_INTERVAL = 10000 // 10 seconds var RECHOKE_OPTIMISTIC_DURATION = 2 // 30 seconds -var TMP = path.join(pathExists.sync('/tmp') ? '/tmp' : os.tmpDir(), 'webtorrent') +var TMP = typeof pathExists.sync === 'function' + ? path.join(pathExists.sync('/tmp') ? '/tmp' : os.tmpDir(), 'webtorrent') + : '/tmp/webtorrent' inherits(Torrent, EventEmitter) diff --git a/package.json b/package.json index bc060b9..02b9b5d 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "bittorrent-dht/client": false, "fs-chunk-store": "memory-chunk-store", "load-ip-set": false, + "os": false, + "path-exists": false, "ut_pex": false }, "bugs": { |