workerd
workerd copied to clipboard
Implement node:fs stubs
This just stubs out the node:fs module with implementations that throw. The intent here is to allow imports/requires to work without actually implementing the fs module.
Goal: Node.js compatibility, Frameworks
Nice! 🙂 Would it be possible to stub out require("node:fs").promises and require("node:fs/promises") too? We currently stub these out (and a few other modules: https://github.com/cloudflare/workers-sdk/tree/main/packages/vitest-pool-workers/src/worker/lib/node) for the Vitest integration, and it would be nice if we didn't have to.
Not sure if we're going to go forward with this or not. There's more to figure out. But if we do move forward with this approach, the idea is to have throwing stubs for all Node.js APIs we don't implement. Stay tuned.
We've decided not to go this direction, thankfully :-)