I gave it a very naive try by just throwing everything out that's not supported in JS to see what would be left - and then I gave up after not too long.
You might want to look into going there with a detour using Emscriptem, I believe that offers some FS abstractions using local storage or something similar.
Is it possible to compile the Nim compiler to Javascript?
Given enough foolishness, all things are possible. But it would probably be unbearably slow. And definitely very inefficient. Heck, one can even run Qemu in the browser, so all you need is a sufficiently fast computer and a lean OS image with Nim installed... What a bizarre and bloated future we live in!
The Nim developer experience is best when the compiler is running on a good CPU, which one can rent for just a couple dollars a month per core (ex. ramnode). So why not use a server?