![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
webtorrent-health
Advanced tools
Get health info about a webtorrent file or magnet link
npm install webtorrent-health
The param torrentId
can be a webtorrent file or magnet link, for more info check out parse-torrent.
webtorrentHealth(torrentId [, opts], callback)
var webtorrentHealth = require('webtorrent-health')
var magnet = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com'
webtorrentHealth(magnet, function (err, data) {
if (err) return console.error(err)
console.log('average number of seeders: ' + data.seeds)
console.log('average number of leechers: ' + data.peers)
console.log('ratio: ', +(Math.round((data.peers > 0 ? data.seeds / data.peers : data.seeds) +'e+2') + 'e-2'))
})
You can also use Promises/A+:
var webtorrentHealth = require('webtorrent-health')
var magnet = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com'
webtorrentHealth(magnet).then(function (data) {
console.log('average number of seeders: ' + data.seeds)
console.log('average number of leechers: ' + data.peers)
console.log('ratio: ', +(Math.round((data.peers > 0 ? data.seeds / data.peers : data.seeds) +'e+2') + 'e-2'))
}).catch(console.error.bind(console))
If you couldn't scrape any of the trackers you will not get any errors, but the returned data will look like this:
{
seeds: 0,
peers: 0,
extra: [...]
}
The attribute extra
is an Array of Objects, that contains more info about the each tracker. Example:
[
{
tracker: 'wss://tracker.openwebtorrent.com',
seeds: 561,
peers: 12967,
downloads: 561,
response_time: 229
},
{
tracker: 'wss://tracker.btorrent.xyz',
seeds: 601,
peers: 19119,
downloads: 601,
response_time: 705
},
{
tracker: 'wss://tracker.badtracker.com',
error: 'connection error to wss://tracker.badtracker.com'
}
]
opts.trackers
: additional trackers to scrape on top of the ones torrentId
has.
webtorrentHealth(torrentId, {
trackers: ['wss://tracker.openwebtorrent.com']
}, function (err, data) {
// Do something
})
opts.blacklist
: don't scrape some trackers.
webtorrentHealth(torrentId, {
blacklist: [
'openbittorrent' // will blacklist any tracker containing that string in its URI
]
}, function (err, data) {
// Do something
})
opts.timeout
: timeout in milliseconds for each request to scarpe the tracker. Default is 1000
.
webtorrentHealth(torrentId, {
timeout: 1500
}, function (err, data) {
// Do something
})
MIT. Copyright (c) Alex
FAQs
Get health info about a webtorrent file or magnet link
The npm package webtorrent-health receives a total of 57 weekly downloads. As such, webtorrent-health popularity was classified as not popular.
We found that webtorrent-health demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.