🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

hyperbundle

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperbundle

Bundle blobs and metadata

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 06 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts