@ctrl/deluge
TypeScript api wrapper for deluge using got
Last updated 3 days ago by scttcper .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ctrl/deluge 
SYNC missed versions from official npm registry.

deluge npm CircleCI coverage status

TypeScript api wrapper for deluge using got

Install

npm install @ctrl/deluge

Use

import { Deluge } from '@ctrl/deluge';

const client = new Deluge({
  baseUrl: 'http://localhost:8112/',
  password: 'deluge',
});

async function main() {
  const res = await client.getAllData();
  console.log(res);
}

API

Docs: https://deluge.netlify.com/

Normalized API

These functions have been normalized between torrent clients. Can easily support multiple torrent clients. See below for alternative supported torrent clients

getAllData

Returns all torrent data and an array of label objects. Data has been normalized and does not match the output of native listTorrents().

const data = await client.getAllData();
console.log(data.torrents);
getTorrent

Returns one torrent data

const data = await client.getTorrent();
console.log(data);
pauseTorrent and resumeTorrent

Pause or resume a torrent

const paused = await client.pauseTorrent();
console.log(paused);
const resumed = await client.resumeTorrent();
console.log(resumed);
removeTorrent

Remove a torrent. Does not remove data on disk by default.

// does not remove data on disk
const result = await client.removeTorrent('torrent_id', false);
console.log(result);

// remove data on disk
const res = await client.removeTorrent('torrent_id', true);
console.log(res);

See Also

transmission - https://github.com/TypeCtrl/transmission
qbittorrent - https://github.com/TypeCtrl/qbittorrent
utorrent - https://github.com/TypeCtrl/utorrent
rtorrent - https://github.com/TypeCtrl/rtorrent

Current Tags

  • 2.2.1                                ...           latest (3 days ago)

28 Versions

  • 2.2.1                                ...           3 days ago
  • 2.2.0                                ...           a month ago
  • 2.1.1                                ...           2 months ago
  • 2.1.0                                ...           2 months ago
  • 2.0.3                                ...           6 months ago
  • 2.0.2                                ...           9 months ago
  • 2.0.1                                ...           9 months ago
  • 2.0.0                                ...           10 months ago
  • 1.8.1                                ...           10 months ago
  • 1.8.0                                ...           10 months ago
  • 1.7.1                                ...           10 months ago
  • 1.7.0                                ...           10 months ago
  • 1.6.0                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.6                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 13
This Month 13
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |