Home Guides Protocol Install Awesome Hacks
Guides Modules Hyperdrive

Hyperdrive

API Docs https://github.com/hypercore-protocol/hyperdrive
Depends On hypercore

Hyperdrive is a secure, real-time distributed file system designed for easy P2P file sharing.

var Hyperdrive = require('hyperdrive')
var drive = new Hyperdrive('./my-first-hyperdrive') // content will be stored in this folder

await drive.promises.writeFile('/hello.txt', 'world')

const list = await drive.promises.readdir('/')
console.log(list) // prints ['hello.txt']

const data = await drive.promises.readFile('/hello.txt', 'utf-8')
console.log(data) // prints 'world'