miracles

Miracles is an event-based magnet link parser for node

node-miracles

Miracles is an event-based magnet link parser for node

npm install miracles

var miracles = require('miracles');
 
var tpbDocumentary = miracles('magnet:?xt=urn:btih:79816060ea56d56f2a2148cd45705511079f9bca&dn=TPB.AFK.2013.720p.h264-SimonKlose&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80');
 
tpbDocumentary.on('root', function(){
    console.log('begining parsing...');
});
 
tpbDocumentary.on('completed', function(parsed){
    console.log(parsed);
});
 
// address /tr/acker paremeter 
tpbDocumentary.on('tr', function(address){
    console.log('encountered tracker:', address);
});

Refer to the official website for the magnet-uri project, the Wikipedia article, and more directly, the specification for more information on parameters and whatnot.