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

support seeding entire folders (string path to folder) #213

Merged
merged 4 commits into from Dec 22, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

delete comments; don't repeat readme

  • Loading branch information
feross committed Dec 17, 2014
commit 6cab794d4df6f3aa6d30d419b3acff6e9ce89f73
@@ -266,10 +266,9 @@ Start seeding a new torrent.
- path to the file or folder on filesystem (string)
- W3C [File](https://developer.mozilla.org/en-US/docs/Web/API/File) object (from an `<input>` or drag and drop)
- W3C [FileList](https://developer.mozilla.org/en-US/docs/Web/API/FileList) object (basically an array of `File` objects)
- W3C [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) object
- Node [Buffer](http://nodejs.org/api/buffer.html) object (works in [the browser](https://www.npmjs.org/package/buffer))

Or, an **array of `File`, `Blob`, or `Buffer` objects**.
Or, an **array of `File` or `Buffer` objects**.

If `opts` is specified, it should contain the following types of options:

@@ -121,15 +121,6 @@ WebTorrent.prototype.get = function (torrentId) {

/**
* Start downloading a new torrent. Aliased as `client.download`.
*
* `torrentId` can be one of:
* - magnet uri (utf8 string)
* - torrent file (buffer)
* - info hash (hex string or buffer)
* - parsed torrent (from [parse-torrent](https://github.com/feross/parse-torrent))
* - http/https url to a torrent file (string)
* - filesystem path to a torrent file (string)
*
* @param {string|Buffer|Object} torrentId
* @param {Object} opts torrent-specific options
* @param {function=} ontorrent called when the torrent is ready (has metadata)
@@ -179,13 +170,6 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) {

/**
* Start seeding a new torrent.
*
* `input` can be any of the following:
* - path to the file or folder on filesystem (string)
* - W3C File object (from an `<input>` or drag and drop)
* - W3C FileList object (basically an array of `File` objects)
* - Array of `File` objects
*
* @param {string|File|FileList|Buffer|Array.<File|Buffer>} input
* @param {Object} opts
* @param {function} onseed
@@ -226,7 +210,6 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {

/**
* Remove a torrent from the client.
*
* @param {string|Buffer} torrentId
* @param {function} cb
*/
@@ -241,8 +224,6 @@ WebTorrent.prototype.remove = function (torrentId, cb) {

/**
* Destroy the client, including all torrents and connections to peers.
*
* @override
* @param {function} cb
*/
WebTorrent.prototype.destroy = function (cb) {
@@ -263,7 +244,7 @@ WebTorrent.prototype.destroy = function (cb) {
}

/**
* Check if `obj` is a W3C Blob object (which is the superclass of W3C File)
* Check if `obj` is a W3C Blob object (which is the superclass of W3C File).
* @param {*} obj
* @return {boolean}
*/
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.