Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJohn Hiesey <john@hiesey.com>2021-03-25 04:09:35 +0300
committerJohn Hiesey <john@hiesey.com>2021-03-25 04:09:35 +0300
commit88ce7aff3c6c43599d1cd2c26d6b15362cc1e94a (patch)
tree15f18d223452de6e87d12d9d24fcd288e8a9624e /docs
parente669ab2cb0488b042ff4bca5ab1549f636f6787d (diff)
Add opts.destroyStoreOnDestroy to torrent
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/api.md b/docs/api.md
index 23a467b..db7441e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -93,6 +93,7 @@ If `opts` is specified, then the default options (shown below) will be overridde
path: String, // Folder to download files to (default=`/tmp/webtorrent/`)
private: Boolean, // If true, client will not share the hash with the DHT nor with PEX (default is the privacy of the parsed torrent)
store: Function // Custom chunk store (must follow [abstract-chunk-store](https://www.npmjs.com/package/abstract-chunk-store) API)
+ destroyStoreOnDestroy: Boolean // If truthy, client will delete the torrent's chunk store (e.g. files on disk) when the torrent is destroyed
}
```
@@ -171,7 +172,8 @@ Always listen for the 'error' event.
Remove a torrent from the client. Destroy all connections to peers and delete all saved file metadata.
-If `opts.destroyStore` is truthy, `store.destroy()` will be called, which will delete the torrent's files from the disk.
+If `opts.destroyStore` is specified, it will override `opts.destroyStoreOnDestroy` passed when the torrent was added.
+If truthy, `store.destroy()` will be called, which will delete the torrent's files from the disk.
If `callback` is provided, it will be called when the torrent is fully destroyed,
i.e. all open sockets are closed, and the storage is either closed or destroyed.