diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-03-25 05:22:49 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-03-25 05:22:49 +0300 |
commit | 03ef03c6d5c527eef05086502bbe1e4856c6aecb (patch) | |
tree | ff9481acf218608a0d4c905fd30602c189b4dc30 /docs | |
parent | fa74f4f74e749e8c1b8dfc560a563b2562ba6300 (diff) |
merge quick-start.md into api.md
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api.md | 31 | ||||
-rw-r--r-- | docs/quick-start.md | 28 |
2 files changed, 31 insertions, 28 deletions
diff --git a/docs/api.md b/docs/api.md index 94cb519..b613d2d 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,3 +1,34 @@ +# WebTorrent Documentation + +WebTorrent is a streaming torrent client for **Node.js** and the **web**. WebTorrent +provides the same API in both environments. + +To use WebTorrent in the browser, [WebRTC] support is required (Chrome, Firefox, Opera). + +[webrtc]: https://en.wikipedia.org/wiki/WebRTC + +## Install + +```bash +npm install webtorrent +``` + +## Quick Example + +```js +var client = new WebTorrent() + +var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d' + +client.add(torrentId, function (torrent) { + // Torrents can contain many files. Let's use the first. + var file = torrent.files[0] + + // Display the file by adding it to the DOM. Supports video, audio, image, etc. files + file.appendTo('body') +}) +``` + # WebTorrent API ## `WebTorrent.WEBRTC_SUPPORT` diff --git a/docs/quick-start.md b/docs/quick-start.md deleted file mode 100644 index b0969e7..0000000 --- a/docs/quick-start.md +++ /dev/null @@ -1,28 +0,0 @@ -WebTorrent is a streaming torrent client for **Node.js** and the **web**. WebTorrent -provides the same API in both environments. - -To use WebTorrent in the browser, [WebRTC] support is required (Chrome, Firefox, Opera). - -[webrtc]: https://en.wikipedia.org/wiki/WebRTC - -## Install - -```bash -npm install webtorrent -``` - -## Quick Example - -```js -var client = new WebTorrent() - -var torrentId = 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d' - -client.add(torrentId, function (torrent) { - // Torrents can contain many files. Let's use the first. - var file = torrent.files[0] - - // Display the file by adding it to the DOM. Supports video, audio, image, etc. files - file.appendTo('body') -}) -``` |