Mount a kappa-drive with hyperdrive-fuse
Kieran Gibb c4d3b2fc57
use latest hyperdrive-fuse
1 year ago
test use latest hyperdrive-fuse 1 year ago
.gitignore gitignore 2 years ago
LICENSE add LICENSE 2 years ago
README.md update README 2 years ago
example.js update example.js 2 years ago
index.js use latest hyperdrive-fuse 1 year ago
package-lock.json 1.0.6 2 years ago
package.json use latest hyperdrive-fuse 1 year ago

README.md

kappa-drive-mount

Mount a kappa-drive with hyperdrive-fuse.

Example

This will mount a kappa-drive for 3 seconds, and then unmount it.

const KappaDrive = require('kappa-drive')
const mount = require('./')

const mountdir = './mnt'
const storage = './drive'
const drive = KappaDrive(storage)

mount(drive, mountdir, (err, unmount) => {
  if (err) return console.error(err)

  setTimeout(() => {
    unmount()
  }, 3000)
})

API

const mount = require('kappa-drive-mount')
mount(drive, destination, [options,] callback)

mount a kappa-drive, drive at path destination. options, if given, will be passed to hyperdrive-fuse.

callback will be given arguments (err, unmount). unmount is a function which can be used to unmount the drive. The drive can also be unmounted by sending the 'SIGINT' event (pressing Ctrl + C).