New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coboxcoop/kappa-drive

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coboxcoop/kappa-drive

a multiwriter peer to peer filesystem

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

peer-fs

A multiwriter peer-to-peer filesystem. Supports Hyperdrive V10.

Usage

See test/index.test.js for examples.

API

var drive = KappaDrive(storage, key, opts)

Returns a KappaCore instance. Passes these options directly to that instance.

In addition, peerfs accepts the following optional arguments:

  • resolveFork: a function taking values of known versions of that file. If there are more than one here, there is a fork. By default, this returns the first item in the list. Overwrite this to get more fancy.
drive.replicate()

Replicate between two peer-fs instances.

drive.readFile(filename, cb)

Read asyncronously.

drive.writeFile(filename, content, cb)

Write asyncronously.

drive.createWriteStream(filename, cb)

Write to a stream.

drive.createReadStream(filename, cb)

Read file from a stream.

License

MIT

Credit

Huge credit to Karissa for ideating and writing peerfs and allowing us to run with it and complete the API.

:black_heart: :purple_heart: :green_heart:

TODO
  • Move all of the functions over from hyperdrive to the top constructor instance. (e.g., readdir, stat)
  • Improve performance and stability of index writes by using something other than JSON.
  • Allow resolveFork function to get access to the stat object of the file on that write so that it can make a more intelligent display or make better decisions about the fork
  • Allow forks to be unresolved cc @substack
  • When writing, in the link we should record the seq of the hyperdrive, and on whoHasFile, checkout to that seq if its not the latest

Keywords

FAQs

Package last updated on 30 Jul 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc