Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/webtorrent/webtorrent
/ functions
Functions
252 in github.com/webtorrent/webtorrent
⨍
Functions
252
◇
Types & classes
26
↓ 151 callers
Method
destroy
(err)
lib/peer.js:231
↓ 105 callers
Method
add
* Start downloading a new torrent. Aliased as `client.download`. * @param {string|Buffer|Object} torrentId * @param {import('./lib/torrent.js').
index.js:260
↓ 45 callers
Method
_debug
(...args)
lib/torrent.js:2091
↓ 43 callers
Method
address
()
index.js:428
↓ 37 callers
Method
seed
* Start seeding a new file/folder. * @param {string|File|FileList|Buffer|Array.<string|File|Buffer>} input * @param {Object=} opts * @param
index.js:307
↓ 36 callers
Method
get
@param {number} index
lib/selections.js:130
↓ 28 callers
Method
close
(cb = () => {})
lib/server.js:246
↓ 27 callers
Method
listen
(...args)
lib/server.js:313
↓ 26 callers
Method
remove
* Remove a torrent from the client. * @param {string|Buffer|Torrent} torrentId * @param {function} cb
index.js:406
↓ 22 callers
Function
assertBlocked
(t, torrent, addr)
test/node/blocklist.js:8
↓ 20 callers
Method
addPeer
(peer, source)
lib/torrent.js:1036
↓ 19 callers
Method
includes
(piece)
lib/file.js:183
↓ 18 callers
Method
createServer
* Creates an http server to serve the contents of this torrent, * dynamically fetching the needed torrent pieces to satisfy http requests. * Ran
index.js:196
↓ 16 callers
Method
arrayBuffer
(opts = {})
lib/file.js:131
↓ 15 callers
Method
destroy
(opts, cb)
lib/torrent.js:947
↓ 14 callers
Method
destroy
* Destroy the client, including all torrents and connections to peers. * @param {function} cb
index.js:465
↓ 14 callers
Method
getRarestPiece
* Get the index of the rarest piece. Optionally, pass a filter function to exclude * certain pieces (for instance, those that we already have).
lib/rarity-map.js:36
↓ 13 callers
Method
createReadStream
(opts)
lib/file.js:118
↓ 12 callers
Function
assertReachable
(t, torrent, addr)
test/node/blocklist.js:15
↓ 12 callers
Method
load
(streams, cb)
lib/torrent.js:2060
↓ 9 callers
Method
_destroy
(err, opts, cb)
lib/torrent.js:953
↓ 9 callers
Method
_update
* Heartbeat to update all peers and their requests.
lib/torrent.js:1580
↓ 8 callers
Method
_destroy
(err, cb)
index.js:470
↓ 8 callers
Method
insert
* @param {SelectionItem & NotificationItem} newItem
lib/selections.js:112
↓ 8 callers
Function
maybeDone
()
test/node/seed-while-download.js:51
↓ 8 callers
Method
select
(priority)
lib/file.js:87
↓ 7 callers
Method
_debug
()
index.js:540
↓ 7 callers
Method
_updateWireInterest
(wire)
lib/torrent.js:1564
↓ 7 callers
Method
deselect
()
lib/file.js:92
↓ 7 callers
Method
downloadSpeed
()
lib/torrent.js:245
↓ 7 callers
Method
recalculate
* Recalculates piece availability across all peers in the torrent.
lib/rarity-map.js:91
↓ 7 callers
Function
runTransferTest
(t, seederLevel, downloaderLevel, expectedMethod)
test/node/encryption.js:19
↓ 7 callers
Function
setupClient
({ t, onTorrent, onIdle, addTorrentProps = {} })
test/node/client-deselect.js:6
↓ 7 callers
Function
toString
* Converts a selection or an array of selections to a human-readable string * @param {{from: number, to: number} | Array<{from: number, to: number}>}
test/selections.js:103
↓ 6 callers
Function
assertList
(t, torrent)
test/node/blocklist.js:77
↓ 6 callers
Function
createServer
(data, cb)
test/node/download-metadata.js:7
↓ 6 callers
Method
destroy
(cb = () => {})
lib/server.js:255
↓ 5 callers
Method
_onListening
()
lib/torrent.js:367
↓ 5 callers
Method
_request
* Attempts to request a block from the given wire.
lib/torrent.js:1923
↓ 5 callers
Method
address
()
lib/server.js:309
↓ 5 callers
Method
clear
()
lib/selections.js:140
↓ 5 callers
Method
handshake
()
lib/peer.js:199
↓ 5 callers
Function
maybeDone
(err)
test/node/download-dht-torrent.js:69
↓ 5 callers
Method
onConnect
* Called once the peer is connected (i.e. fired 'connect' event) * @param {Socket} conn
lib/peer.js:64
↓ 4 callers
Method
_checkDone
()
lib/torrent.js:2023
↓ 4 callers
Method
_onWire
(wire, addr)
lib/torrent.js:1290
↓ 4 callers
Method
_updateSelections
* Called on selection changes.
lib/torrent.js:1516
↓ 4 callers
Method
_verifyPiecesUsingHash
* Verifies the pieces of the torrent using hashing ( it can be very slow ) * @param {Array<number>} pieces * @param {callbackWithError} cb *
lib/torrent.js:805
↓ 4 callers
Function
cleanup
()
lib/worker-server.js:44
↓ 4 callers
Function
cleanup
()
lib/peer.js:290
↓ 4 callers
Function
getPageHTML
(title, pageHtml)
lib/server.js:425
↓ 4 callers
Function
maybeDone
()
test/node/download-dht-magnet.js:64
↓ 4 callers
Function
maybeDone
()
test/node/download-webseed-magnet.js:36
↓ 4 callers
Function
maybeDone
()
test/node/download-tracker-magnet.js:85
↓ 4 callers
Function
maybeDone
()
test/node/blocklist-dht.js:57
↓ 4 callers
Function
setPiece
(wire, index)
test/rarity-map.js:104
↓ 4 callers
Method
sort
@param {(a: SelectionItem, b: SelectionItem) => number} sortFn
lib/selections.js:121
↓ 4 callers
Function
testSpeed
(t, downloaderOpts, uploaderOpts, cb)
test/node/limit-methods.js:9
↓ 4 callers
Function
testSpeed
(t, downloaderOpts, uploaderOpts, cb)
test/node/limit-download-upload.js:9
↓ 3 callers
Method
_addPeer
(peer, type, source)
lib/torrent.js:1076
↓ 3 callers
Method
_drain
* Pop a peer off the FIFO queue and connect to it. When _drain() gets called, * the queue will usually have only one peer in it, except when there
lib/torrent.js:2102
↓ 3 callers
Method
_markAllVerified
* Mark the entire torrent as verified ( i.e. fully downloaded ) * @private
lib/torrent.js:861
↓ 3 callers
Method
_markVerified
* Mark one piece as verified * @param {number} index * @private
lib/torrent.js:872
↓ 3 callers
Method
_onMetadata
* Called when the full torrent metadata is received.
lib/torrent.js:555
↓ 3 callers
Method
_onStore
* Called when the metadata, listening server, and underlying chunk store is initialized.
lib/torrent.js:921
↓ 3 callers
Method
_registerPeer
* @param {Peer} newPeer
lib/torrent.js:1183
↓ 3 callers
Function
assertArrayContentsEqual
* Asserts that the given arrays of selections have the same from-to pairs, regardless of order * @param {import('tape').Test} t * @param {Array<Sele
test/selections.js:117
↓ 3 callers
Method
cancel
()
lib/file.js:167
↓ 3 callers
Method
destroy
* Destroy this Conn pool. * @param {function} cb
lib/conn-pool.js:81
↓ 3 callers
Method
destroy
(cb = _ => {}, err)
lib/file-iterator.js:103
↓ 3 callers
Function
getBlockPipelineLength
(wire, duration)
lib/torrent.js:2207
↓ 3 callers
Function
getPiecePipelineLength
(wire, duration, pieceLength)
lib/torrent.js:2221
↓ 3 callers
Function
isCoveringExisting
(newItem, existing)
lib/selections.js:205
↓ 3 callers
Function
isInsideExisting
(newItem, existing)
lib/selections.js:191
↓ 3 callers
Function
isLowerIntersecting
(newItem, existing)
lib/selections.js:167
↓ 3 callers
Function
isUpperIntersecting
(newItem, existing)
lib/selections.js:179
↓ 3 callers
Function
magnetDownloadTest
(t, serverType)
test/node/download-tracker-magnet.js:27
↓ 3 callers
Method
remove
* @param {MinimalSelectionItem & {isStreamSelection?: boolean}} item Interval to be removed from the selection
lib/selections.js:28
↓ 3 callers
Method
removePeer
(peer)
lib/torrent.js:1219
↓ 3 callers
Method
return
* @returns {Promise<IteratorResult<Uint8Array>>}
lib/file-iterator.js:90
↓ 3 callers
Method
select
(start, end, priority, notify)
lib/torrent.js:1260
↓ 3 callers
Function
serve
({ request })
lib/worker-server.js:20
↓ 3 callers
Method
serve404Page
(res)
lib/server.js:64
↓ 3 callers
Function
torrentDownloadTest
(t, serverType)
test/node/download-tracker-torrent.js:27
↓ 2 callers
Method
_addIncomingPeer
* Called whenever a new incoming TCP peer connects to this torrent swarm. Called with a * peer that has already sent a handshake.
lib/torrent.js:1171
↓ 2 callers
Method
_cleanupWireEvents
(wire)
lib/rarity-map.js:101
↓ 2 callers
Method
_deselect
(from, to, isStreamSelection = false)
lib/torrent.js:1264
↓ 2 callers
Method
_gcSelections
* Garbage collect selections with respect to the store's current state.
lib/torrent.js:1529
↓ 2 callers
Method
_hasMorePieces
(threshold)
lib/torrent.js:907
↓ 2 callers
Method
_initWire
(wire)
lib/rarity-map.js:74
↓ 2 callers
Method
_isIPv4
* Return `true` if string is a valid IPv4 address. * @param {string} addr * @return {boolean}
lib/torrent.js:2201
↓ 2 callers
Method
_onConnection
* On incoming connections, we expect the remote peer to send a handshake first. Based * on the infoHash in that handshake, route the peer to the ri
lib/conn-pool.js:124
↓ 2 callers
Method
_onParsedTorrent
(parsedTorrent)
lib/torrent.js:297
↓ 2 callers
Method
_onTorrentId
* Parse a torrent from its magnet/torrent file/remote url and kickstart downloading it * @param {string|ArrayBufferView|Object} torrentId * @ret
lib/torrent.js:273
↓ 2 callers
Method
_onWireWithMetadata
* @param {import('bittorrent-protocol').default} wire
lib/torrent.js:1397
↓ 2 callers
Method
_processParsedTorrent
(parsedTorrent)
lib/torrent.js:329
↓ 2 callers
Method
_remove
(torrent, opts, cb)
index.js:415
↓ 2 callers
Method
_select
(start = 0, end = this.pieces.length - 1, priority, notify, isStreamSelection = false)
lib/torrent.js:1236
↓ 2 callers
Method
_startDiscovery
()
lib/torrent.js:380
↓ 2 callers
Method
_updateInterest
* Update interested status for all peers.
lib/torrent.js:1553
next →
1–100 of 252, ranked by callers