Bundle blobs and metadata
npm install hyperbundle
const bundle = new Hyperbundle(corestore, optionalKey)
const ws = bundle.createWriteStream('/blob.txt')
ws.write('hello')
ws.write('world')
ws.end()
ws.on('close', function () {
const rs = bundle.createReadStream('/blob.txt')
rs.pipe(process.stdout) // prints helloworld
})
stream = bundle.entries(opts)Get all entries as Hyperbee nodes. Takes Hyperbee createReadStream options.
stream = bundle.diff(earlierLength)Make a diff stream of the metadata data.
ws = bundle.createWriteStream(keyOrEntry, [opts])Insert a blob. Options include
{
// set the executuable flag in the metadata
executable: true | false
}
rs = bundle.createReadStream(key)Read out a blob
await bundle.put(key, buf, [opts])Non-stream version of createWriteStream.
buf = await bundle.get(key)Non-stream version of createReadStream.
await bundle.del(key)Delete a blob.
node = await bundle.entry(key)Get the Hyperbee node for a blob.
bundle.symlink(key, target)Store a symlink. Symlinks are currently not followed on read.