isomorphic-git / lightning-fs

A lean and fast 'fs' for the browser
MIT License
476 stars 47 forks source link

HTTP Backing Without Superblock File #31

Closed fuzzyTew closed 4 years ago

fuzzyTew commented 4 years ago

It seems when a url option is passed, a .superblock.txt file must be provided at the url, listing the available files. Creating this file is not always possible, and when it is missing, the _cache.stat() check in readFile at https://github.com/isomorphic-git/lightning-fs/blob/master/src/PromisifiedFS.js#L150 throws an error, preventing the reading of any remote files.

It might be nice if there were a way to specify that files are present when the superblock file is not, or when it is missing content. A method like fs.backFile() maybe that would add an entry to the cache.

Orthogonally, that readFile line could be skipped when there is no superblock file, maybe a HEAD request performed instead.

fuzzyTew commented 4 years ago

32 was a preliminary fix for this