jvilk / BrowserFS

BrowserFS is an in-browser filesystem that emulates the Node JS filesystem API and supports storing and retrieving files from various backends.
Other
3.07k stars 217 forks source link

Proxy FS #197

Closed billiegoose closed 1 year ago

billiegoose commented 7 years ago

or Middleware FS. or Hook FS. Or Instrument FS? I can be indecisive. Fixes #196

The goal is a backend that will proxy (wrap) any existing backend, while letting you the user hook into some of the internals. This will make it trivial to implement file-system "watching" behavior. Currently I'm planning these hooks:

I am also contemplating whether or not to add transform hooks. These would allow modifying the behavior of a file system by letting you transform the arguments and results. This is a much trickier feature. Having transform hooks would enable rapidly prototyping filesystems in user-space, with whatever pros and cons that brings. (Think of FUSE in Linux)

billiegoose commented 7 years ago

DON'T MERGE IT YET!!!

Feedback on how to achieve my goals with less typing would be appreciated. I tried some simpler ways than what I'm doing, but I couldn't get the type checker to like them.

billiegoose commented 7 years ago

Currently I have only wrapped readFileSync and writeFileSync. However I did make a lovely factory to test that all the pass-through functionality works.

emeryberger commented 1 year ago

Looks like this should be closed, correct?

emeryberger commented 1 year ago

I'm going to close this since it's been idle for years. Please feel free to post a comment and I can always re-open it.