Takes a torrent file and returns it's magnet uri.
Install via
npm install torrent2magnet
const torrent2magnet = require('torrent2magnet');
# Async
torrent2magnet(torrentUrl, options, (err, uri) => {
if (err) {
return console.error(err);
}
console.log(uri);
});
# Promise
torrent2magnet(torrentUrl, options).then(uri => {
console.log(uri);
}).catch(err => {
console.error(err);
});
# Sync
try {
console.log(torrent2magnet(torrentUrl));
} catch (err) {
console.log(err);
}
MIT
Fork of apsdehal/torrent-to-magnet.