A multiwriter peer-to-peer filesystem. Supports Hyperdrive V10.
See test/index.test.js for examples.
Returns a KappaCore instance. Passes these options directly to that instance.
In addition, peer-fs accepts the following optional arguments:
resolveFork
: a function takingvalues
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.
Replicate between two peer-fs
instances.
Read asyncronously.
Write asyncronously.
Write to a stream.
Read file from a stream.
Check a file exists
Truncate a file
List all files within a specified directory
MIT
Huge credit to Karissa for ideating and writing peerfs and allowing us to run with it and complete the API.
๐ค ๐ ๐
- Move all of the functions over from hyperdrive to the top constructor instance (e.g. 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