-
Notifications
You must be signed in to change notification settings - Fork 15k
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
How to allow external packages to use original-fs #2035
Comments
Within Electron we are attempting to use a library (adm-zip) which uses But (for various reasons) that's a problem. We want adm-zip to get the Is there any way to temporarily reinstate/rebind Further background: We're using adm-zip to unzip a file which contains a |
You can do it by monkey-patch: fs = require('fs')
originalFs = require('original-fs')
for name, method of originalFs
fs[name] = method |
That did the trick, many thanks. |
Apologies to revive a closed issue, @zcbenz, I tried your suggestion but get an error: If I do a monkey-patch like this - what is a good practice to ensure you aren't breaking something else? Do you need to revert the monkey-patch after including the modules that need
Any suggestions for best practice around this? This has definitely been problematic for me - I've been forking modules and adding |
My project is in ClojureScript, not pure JS otherwise I would provide my source code, but what I do is patch just before the calls to my external lib then unpatch once they're done. Seems the safest thing to do. |
Hello, I'm facing the same issue and I'm a beginner. Can you help on how to apply your patch? Thanks, |
Updated description in next comment...
The text was updated successfully, but these errors were encountered: