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
diff options
context:
space:
mode:
authorDiego Rodríguez Baquero <github@diegorbaquero.com>2021-07-03 01:33:07 +0300
committerGitHub <noreply@github.com>2021-07-03 01:33:07 +0300
commit0e2c88e9ebcccc9d831fc06deda16cea24247281 (patch)
tree550a3b9cfadee5c6500a14eaf2eb6106cb19e005 /README.md
parent5917ac93da67fe02929af2bacc4c192660716aa1 (diff)
docs: no more var (#2123)
* docs: no more var * Update api.md * remove var * remove var
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index ae6a50d..e2c9018 100644
--- a/README.md
+++ b/README.md
@@ -133,10 +133,10 @@ standards (no plugins, just HTML5 and WebRTC)! It's easy to get started!
##### Downloading a file is simple:
```js
-var WebTorrent = require('webtorrent')
+const WebTorrent = require('webtorrent')
-var client = new WebTorrent()
-var magnetURI = '...'
+const client = new WebTorrent()
+const magnetURI = '...'
client.add(magnetURI, function (torrent) {
// Got torrent metadata!
@@ -153,10 +153,10 @@ client.add(magnetURI, function (torrent) {
##### Seeding a file is simple, too:
```js
-var dragDrop = require('drag-drop')
-var WebTorrent = require('webtorrent')
+const dragDrop = require('drag-drop')
+const WebTorrent = require('webtorrent')
-var client = new WebTorrent()
+const client = new WebTorrent()
// When user drops files on the browser, create a new torrent and start seeding it!
dragDrop('body', function (files) {