hyperdrive-haus

1.0.0 • Public • Published

hyperdrive-haus

A hyperdrive javascript API for dat.haus

NPM

var haus = require('hyperdrive-haus')
var archive = haus('archive-key-here')

archive.list(function (err, files) {
  console.log(files) // list of files
})

API

var archive = haus(archive, opts)

archive: a hyperdrive archive or a hex encoded hyperdrive string. opts:

  • url: the URL for dat.haus, defaults to http://dat.haus

archive.createFileReadStream(entry)

Creates a read stream of the file with a given file name

Example:

var readStream = archive.createFileReadStream('hello.txt')
readStream.pipe(process.stdout)

archive.list(callback)

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)
})

Readme

Keywords

none

Package Sidebar

Install

npm i hyperdrive-haus

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • karissa