Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy-fs #49

Open
cadorn opened this issue Sep 5, 2013 · 4 comments
Open

Proxy-fs #49

cadorn opened this issue Sep 5, 2013 · 4 comments
Assignees

Comments

@cadorn
Copy link
Collaborator

cadorn commented Sep 5, 2013

I want to be able to instanciate a proxy fs where the proxy loads and caches all lower level FS data as methods are called on the proxy object.

I want to then serialize the proxy data to a file and later instanciate a mock-fs object with it.

The idea is that I can pass a virtual FS object to a library, record all FS data needed while library executes and on second run feed the cached FS to the library instead of a real FS.

How would this fit into the q-io ecosystem?

@kriskowal
Copy link
Owner

@cadorn It would be very similar to fs-mock https://github.com/kriskowal/q-io/blob/master/fs-mock.js. It would be fine in a separate package or even here. You will find that it would be cohesive with a bunch of the Q-IO internals.

@kriskowal
Copy link
Owner

@cadorn Have you moved on this, or is it something you’re still looking for?

@cadorn
Copy link
Collaborator Author

cadorn commented Oct 31, 2013

Not yet.

I have started some work on shadowing FS calls so you can get events for paths being used: https://github.com/pinf/pinf-for-nodejs/blob/9f31624eeb4aecbd819893c55872a602f2b00389/lib/vfs.js

I'll be combining shadow-fs with a proxy-fs and another proxy I already have for HTTP[S] requests. The goal is to record all assets used by a package during build and at runtime. All this should have a callback and promise interface.

@cadorn
Copy link
Collaborator Author

cadorn commented Oct 31, 2013

The well-tested HTTP[S] caching proxy is here: https://github.com/sourcemint/util-js/blob/master/lib/url-proxy-cache.js
It works by keeping an additional meta file per URI. I hope to use the same approach for proxy-fs and re-use the same cache logic.

@kriskowal kriskowal removed their assignment Sep 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants