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

show-and-tell: fs-require #251

Open
privatenumber opened this issue May 27, 2021 · 0 comments
Open

show-and-tell: fs-require #251

privatenumber opened this issue May 27, 2021 · 0 comments

Comments

@privatenumber
Copy link

First of all, thank you for your work on all these fs libraries @streamich. I use them in a lot of my libraries and they have saved me a lot of time and improved my DX.

I wanted to share a library I recently developed that might fit in well with the rest of your fs-suite: fs-require.

It's a localized version of fs-monkey for require()ing from a fs instance (eg. memfs). So instead of patching the global require(), it returns a new one that only reads from the given fs instance.

I am using it for testing a Webpack plugin by creating disposable fs instances using memfs and requiring the distribution code to see if it works.

If you'd like, I'd be happy to open a PR to add it to the "Reference" section in your README.md.

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

1 participant