Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs #694

Closed
wants to merge 10 commits into from

Remove concrete ways of install and use modules

Remove concrete ways of install and use modules from examples for browser environment.
  • Loading branch information
FluorescentHallucinogen committed Mar 25, 2016
commit caf2ce42b52e19b477ba4dd842c9972aa6a9097c
@@ -36,8 +36,6 @@ var WebTorrent = require('webtorrent')
### Downloading a torrent (in the browser)

```js
var WebTorrent = require('webtorrent')
var client = new WebTorrent()
// Sintel, a free, Creative Commons movie
@@ -63,10 +61,25 @@ the needed torrent pieces from the network on-demand.

### Creating a new torrent and seed it (in the browser)

This example uses the [`drag-drop`][drag-drop] package, to make the HTML5 Drag and
Drop API easier to work with.

It works in the browser with [browserify](http://browserify.org).

```
npm install drag-drop
```

Then use `drag-drop` like this:

```js
var dragDrop = require('drag-drop')
var WebTorrent = require('webtorrent')
```

**Note:** If you do not use browserify, use the included standalone file
`dragdrop.min.js`. This exports a `DragDrop` function on `window`.

```js
var client = new WebTorrent()
// When user drops files on the browser, create a new torrent and start seeding it!
@@ -77,9 +90,6 @@ dragDrop('body', function (files) {
})
```

This example uses the [`drag-drop`][drag-drop] package, to make the HTML5 Drag and
Drop API easier to work with.

### Download and save a torrent (in Node.js)

```js
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.