hyperlib

Manage hyperdb-based archives.

Usage no npm install needed!

<script type="module">
  import hyperlib from 'https://cdn.skypack.dev/hyperlib';
</script>

README

hyperlib

Manage many hyperdbs or hyperdb based modules (like hyperdrives). Archives can have mounts, pointers to other archives.

WIP and not yet stable!

Example

const storage = './db'
const archiveTypes = {
  hyperdrive: require('hyperlib/wrappers/hyperdrive')
}

const library = hyperlib(storage, { archiveTypes })

const archive = await library.createArchive('hyperdrive')
// share on network.
archive.setShare(true)
// add mount
archive.makePersistentMount('hyperdrive', 'my-mountpoint')

// add remote archive:

let key
const other = await library.addRemoteArchive('hyperdrive', key)

// if this would have mounts, they would be synced with the other archive.
// could be accessed like this:
let mounts = other.getMounts()
// or
let mount = other.getMount('my-mountpoint')