This one’s fairly straightforward but is going to involve a bit of rote work and occasional creativity! This is a refactor that I’d like to do, and I was about to start doing it myself when I realized it’d be great for someone just getting started with the codebase – if this is you, then today’s your lucky day!
The task is straightforward and involves two steps:
- Rewrite all current functions in
lib/node/fs.jsto be “optimistic” about original ops. That is, they should try hitting the original file and doing their normal behavior and only falling back to
tinkif that fails (usually with
- Go through the API for Node.js’
fsmodule and fill out any remaining functions that need to be backfilled. Some of these backfills are special: for example,
openneeds to extract the file first and let the user have a normal file.
fs.write*operations would need their parent directories created if they’re missing, etc.
I’ve started the refactor, which should give you an idea of the changes I’m hoping to do. If you only want to do some of it and tag-team someone else in later, that is also completely fine.
Are you interested in taking this one up? Just reply to this post and claim it! I’m hoping someone will be able to get it done this week, and I don’t expect it to take more than a few hours since it’s so self-contained and involves such small functions, one at a time.