torget v0.0.5
torget
A Node.js torrent file picker and downloader.
##Quick Start For example, if you want to download a Ubuntu Server torrent file, you could do the following:
var torget = require('torget');
torget('ubuntu server', null, function(err, filename) {
if (err) {
console.log(err);
process.exit(1);
} else {
console.log('great success! Saved as: ' + filename);
process.exit(0);
}
});Or, if you are using torget directly from the command line, you could do:
$ torget ubuntu serverThis will launch an interactive mode where you can see a table with the search results and select which torrent to download. Ctrl+c to cancel. You can add the --auto command to avoid the interactive seleciton process. In --auto mode, the first result will be returned.
##Installation torget requires node.js and npm to run. To install, simply run:
npm install torgetIf you want a global install so that you can run torget from the shell anywhere on your system, then add the -g flag to the previous command:
npm install -g torget##API
###torget(query, options, callback) Automatically search, select and download torrent file
querya search queryoptionsoptions object described below - can be omittedcallbackfunction(err, filename) - err is none on success.
###torget.select(query, options, callback) Automatically search and select torrent, but return torrent object instead of downloading
querya search queryoptionsoptions object described below - can be omittedcallbackfunction(err, torrent) - err is none on success.
###torget.interactive(query, options, callback) Search and select a torrent interactively, but return torrent object instead of downloading
querya search queryoptionsoptions object described below - can be omittedcallbackfunction(err, torrent) - err is none on success.
###torget.search(query, callback) Search and return list of torrent objects
querya search querycallbackfunction(err, results) - err is none on success.
###torget.download(torrent, options, callback) Download a torrent file to disk using torcache.js.
torrenta torrent object yielded from select/interactive or search methods. Must contain hash and title.optionsoptions object described below - can be omittedcallbackfunction(err, filename) - err is none on success.
###options
nmax number of results to displayptorrent file download pathaauto donwload flag
###torrent
titlecategorylinkguidpubDatetorrentLinkfiles# of filescomments# of commentshashpeers# of peersseeds# of seedsleechs# of leechssizein bytesvotes# of votesverified1 or 0