Skip to content

module: allow monkey-patching internal fs binding

For third party embedders that implement virtual filesystems, they must override methods of internalBinding('fs') to monkey-patch the module system, and to achieve so they must patch Node. Here are a few of them:

Pkg: https://github.com/vercel/pkg-fetch/blob/main/patches/node.v16.4.1.cpp.patch#L214-L234 Electron: https://github.com/electron/electron/blob/063ac1971244e9d0411a6046e4840c975e38f726/patches/node/refactor_allow_embedder_overriding_of_internal_fs_calls.patch Yode: https://github.com/yue/node/commit/72406854acf1ce69d841be31bff9ad4f1b6a000c

Since every embedder is doing this, I think it makes sense to have the change in Node.

/cc @nodejs/embedders

Merge request reports

Loading