What's special about node.js here? Does golang, C#, python, ruby, java, etc... have a virtual file system?
I get it, I've implemented things for tests, I'm just wondering if this shouldn't be solved at an OS level.
--- update
Let's put this another way, my code does effectively, child_process.spawn('something-that-reads-and-write-a-file')
now I'm back to the same issue. To test I need a virtual file system. Node providing one won't help.
In the past, I've implemented this in Ruby and elixir on Linux systems using a ramdisk.
Python doesn't have a virtual filesystem in general but it is possible to shim the import mechanism.
Java, Haskell, Rust, and several other languages do have solutions for this. Here’s one for Rust: https://docs.rs/vfs/latest/vfs/
Go actually does https://pkg.go.dev/embed
I do think it's more painful to distribute files when you're a distributed as a single binary vs scripts, since the latter has to figure out bundling of files anyway.
But still - it does exist