diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-03-16 23:59:34 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-03-16 23:59:34 +0300 |
commit | b80d5e9c90e71f5f94eaa60bcf94e0b870b0c141 (patch) | |
tree | 20cf6af40170411aec0a32f1e776612c42eb906d | |
parent | 1e8755dce41ac75e37188cf208244795d1666d27 (diff) |
doc tweak
-rw-r--r-- | docs/api.md | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/api.md b/docs/api.md index 963543d..30091d7 100644 --- a/docs/api.md +++ b/docs/api.md @@ -84,10 +84,17 @@ If `opts` is specified, it should contain the following types of options: If `onseed` is specified, it will be called when the client has begun seeding the file. -> Note: The torrent specification requires that every torrent have a name. If one is not explicitly provided through `opts`, WebTorrent will determine the torrent name with the following logic: -> * If all of the files share a common prefix, that prefix will become the torrent name. For example, if all of the files start with `/imgs/` the torrent name will be `imgs` -> * Otherwise, the name of the first file passed in to `client.seed`, for example if the first file is `/foo/bar/baz.txt`, the torrent name will be `baz.txt` -> The `torrent` object will contain a list of files, whose names are prefixed with the torrent name. When creating a nameless torrent in Node, this will be intuitive. When doing the same in the browser, this may lead to confusing results. +**Note:** The torrent specification requires that every torrent have a name. If one is not +explicitly provided through `opts`, WebTorrent will determine the torrent name with the +following logic: + +- If all of the files share a common prefix, that prefix will become the torrent name. + For example, if all of the files start with `/imgs/` the torrent name will be `imgs` +- Otherwise, the name of the first file passed in to `client.seed`, for example if the + first file is `/foo/bar/baz.txt`, the torrent name will be `baz.txt` +- The `torrent` object will contain a list of files, whose names are prefixed with the + torrent name. When creating a nameless torrent in Node, this will be intuitive. When + doing the same in the browser, this may lead to confusing results. ### `client.on('torrent', function (torrent) {})` |