A simple Deluge NodeJs API interface/wrapper, asynchronous NodeJs module to interact with the Deluge torrent client API.
npm install --save node-deluge
First 'require' the package into your project node-deluge accepts 3 parameters as input:
hostname:
your server's url, eg.deluge.nusrath.com
or192.168.1.111
password:
your server'spassword
port:
theport
your server consumes - the default is8112
, if you are running the default port, usenull
here
var deluge = require('node-deluge')(hostname, password, port).then(function (res) {
// res is true if authentication is good, false otherwise.
});
The syntax is as follows:
var deluge = require('node-deluge')(hostname, password, port).then(function (res) {
// res is true if authentication is good, false otherwise.
return deluge.getStatus(); // OR deluge.getConfig(), currently only two methods available
}).then(function (data) {
// do something with the data..
deluge.close(); // by default node-deluge keeps the connection open and so programs won't terminate without this
});
Include all methods mentioned in the link specified in the 'RESOURCES' section