From 15a6f3c715dbc55036fb655905128e8147a7de86 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sat, 7 Jun 2014 15:15:00 -0700 Subject: [PATCH] require('bittorrent-tracker') returns Client --- README.md | 2 +- index.js | 8 ++++++-- test/client-large-torrent.js | 2 +- test/client-magnet.js | 2 +- test/client.js | 2 +- test/server.js | 2 +- test/udp-client.js | 2 +- test/udp-server.js | 2 +- 8 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 86a93b3..d03dbd4 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ npm install bittorrent-tracker To connect to a tracker, just do this: ```js -var Client = require('bittorrent-tracker').Client +var Client = require('bittorrent-tracker') var parseTorrent = require('parse-torrent') var fs = require('fs') diff --git a/index.js b/index.js index 2eeb8b0..1f79a6e 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,6 @@ -exports.Client = require('./client') -exports.Server = require('./server') +var Client = require('./client') +var Server = require('./server') + +module.exports = Client +module.exports.Client = Client +module.exports.Server = Server diff --git a/test/client-large-torrent.js b/test/client-large-torrent.js index 1139d10..6f0ddd0 100644 --- a/test/client-large-torrent.js +++ b/test/client-large-torrent.js @@ -1,4 +1,4 @@ -var Client = require('../').Client +var Client = require('../') var fs = require('fs') var parseTorrent = require('parse-torrent') var portfinder = require('portfinder') diff --git a/test/client-magnet.js b/test/client-magnet.js index 2280957..a28e397 100644 --- a/test/client-magnet.js +++ b/test/client-magnet.js @@ -1,4 +1,4 @@ -var Client = require('../').Client +var Client = require('../') var fs = require('fs') var magnet = require('magnet-uri') var portfinder = require('portfinder') diff --git a/test/client.js b/test/client.js index 6ff41c2..7b35c62 100644 --- a/test/client.js +++ b/test/client.js @@ -1,4 +1,4 @@ -var Client = require('../').Client +var Client = require('../') var fs = require('fs') var parseTorrent = require('parse-torrent') var portfinder = require('portfinder') diff --git a/test/server.js b/test/server.js index 1b6990d..c3099f1 100644 --- a/test/server.js +++ b/test/server.js @@ -1,4 +1,4 @@ -var Client = require('../').Client +var Client = require('../') var portfinder = require('portfinder') var Server = require('../').Server var test = require('tape') diff --git a/test/udp-client.js b/test/udp-client.js index 47d55bf..2ce6dfb 100644 --- a/test/udp-client.js +++ b/test/udp-client.js @@ -1,4 +1,4 @@ -var Client = require('../').Client +var Client = require('../') var fs = require('fs') var parseTorrent = require('parse-torrent') var portfinder = require('portfinder') diff --git a/test/udp-server.js b/test/udp-server.js index 1f85e09..a034c15 100644 --- a/test/udp-server.js +++ b/test/udp-server.js @@ -1,4 +1,4 @@ -var Client = require('../').Client +var Client = require('../') var portfinder = require('portfinder') var Server = require('../').Server var test = require('tape')