3.0.1 • Published 7 years ago

hypertorrent v3.0.1

Weekly downloads
15
License
-
Repository
github
Last release
7 years ago

hypertorrent stability

npm version build status downloads js-standard-style

Stream a torrent into a hyperdrive

Usage

  Usage:
    $ hypertorrent <magnet link or .torrent file> [output location]

  Commands:
    <default>  Convert a torrent link or file to a hyperdrive, returns a key

  Options:
    -d, --daemon          Keep all open after torrent is done downloading
    -h, --help            Print usage
    -k, --keep-uploading  Keep hyperdrive open after torrent is done downloading
    -v, --version         Print version

  Examples:
    $ hypertorrent ./my-science-data.torrent /tmp/foobar

JS API

var hyperdiscovery = require('hyperdiscovery')
var hypertorrent = require('hypertorrent')
var memdb = require('memdb')

var db = memdb()
var ht = hypertorrent('<magnet-link>', db, function (err) {
  if (err) throw err
})

var archive = ht.archive // hyperdrive instance
var torrent = ht.torrent // webtorrent instance

hyperdiscovery(archive)   // expose it to the network

API

ht = hypertorrent(bufferOrMagnetLink, db, opts, callback)

Create a new hypertorrent instace from a Buffer containing the contents of a .torrent file or a magnet link. Takes a level database to store the files. opts is passed directly to hyperdrive; it takes an extra property of .key to create the public key if already exists.

archive = ht.archive

The hyperdrive instance created by hypertorrent

torrent = ht.torrent

The webtorrent instance created by hypertorrent

See Also

License

MIT