A multiwriter peer-to-peer filesystem.
See test.js for examples.
- 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 othe 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: https://github.com/karissa/peerfs/blob/master/index.js#L105-L106
var fs = peerfs(storage, opts)
Returns a KappaCore instance. Passes these options directly to that instance.
In addition, peerfs accepts the following optional arguments:
resolveFork: a function taking
valuesof 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
fs.writeFile(filename, content, cb)
Write to a stream.
Read file from a stream.