From b4f2040bbf6968c28bb20367ed895310b8e04fa3 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 2 Dec 2015 22:47:34 -0800 Subject: [PATCH] browser: exclude two unused packages --- lib/torrent.js | 8 +++++--- package.json | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/torrent.js b/lib/torrent.js index 64d38ffe..6d50b5ca 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 bc060b90..02b9b5d4 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": {