A hyperdrive javascript API for dat.haus
var haus = require('hyperdrive-haus')
var archive = haus('archive-key-here')
archive.list(function (err, files) {
console.log(files) // list of files
})
archive
: a hyperdrive archive or a hex encoded hyperdrive string.
opts
:
-
url
: the URL for dat.haus, defaults tohttp://dat.haus
Creates a read stream of the file with a given file name
Example:
var readStream = archive.createFileReadStream('hello.txt')
readStream.pipe(process.stdout)
List the files in the archive. Takes an optional callback. Will return a stream if callback not supplied.
var stream = archive.list()
stream.on('data', function (entry) {
console.log(entry)
})