Skip to content

Commit f2f4990

Browse files
authored
Add subpath import for client and server (webtorrent#535)
1 parent 8b02864 commit f2f4990

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ To start a BitTorrent tracker server to track swarms of peers:
160160

161161
```js
162162
import { Server } from 'bittorrent-tracker'
163+
// Or import Server from 'bittorrent-tracker/server'
163164

164165
const server = new Server({
165166
udp: true, // enable udp server? [default=true]
@@ -267,6 +268,8 @@ Scraping multiple torrent info is possible with a static `Client.scrape` method:
267268

268269
```js
269270
import Client from 'bittorrent-tracker'
271+
// Or import Client from 'bittorrent-tracker/client'
272+
270273
Client.scrape({ announce: announceUrl, infoHash: [ infoHash1, infoHash2 ]}, function (err, results) {
271274
results[infoHash1].announce
272275
results[infoHash1].infoHash

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@
6464
"node": ">=16.0.0"
6565
},
6666
"exports": {
67-
"import": "./index.js"
67+
".": {
68+
"import": "./index.js"
69+
},
70+
"./client": {
71+
"import": "./client.js"
72+
},
73+
"./server": {
74+
"import": "./server.js"
75+
}
6876
},
6977
"keywords": [
7078
"bittorrent",

0 commit comments

Comments
 (0)