1.2.0 • Published 2 years ago

hyperbundle v1.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

hyperbundle

Bundle blobs and metadata

npm install hyperbundle

Usage

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

API

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.

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

7 years ago