diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-08-28 21:41:08 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-08-28 21:41:08 +0300 |
commit | 41a6b3f60b22fd1996e249507a5e2719e71e3d57 (patch) | |
tree | 5d9560bed2ff6cd366907b7768e1449c59c70f9b | |
parent | c1b5867b6b837b70349bd99f1b6e60c570117742 (diff) | |
parent | 97172234633cd7d53b119cb1a37335f21a6ec962 (diff) |
Merge pull request #410 from Stiveknx/master
Add torrent.path property and update README with new properties
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | lib/torrent.js | 5 |
2 files changed, 17 insertions, 0 deletions
@@ -333,6 +333,18 @@ the file has. The attached [bittorrent-swarm](https://github.com/feross/bittorrent-swarm) instance. +#### `torrent.received` + +Get total bytes received from peers (including invalid data) + +#### `torrent.downloaded` + +Get total bytes received from peers (excluding invalid data) + +#### `torrent.path` + +Get the torrent download location + #### `torrent.destroy()` Alias for `client.remove(torrent)`. diff --git a/lib/torrent.js b/lib/torrent.js index c3a9cf4..c7c7521 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -99,6 +99,11 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', { } }) +// Torrent Path +Object.defineProperty(Torrent.prototype, 'path', { + get: function () { return this._path; } +}) + // Bytes completed (excluding invalid data) Object.defineProperty(Torrent.prototype, 'downloaded', { get: function () { |