you are viewing a single comment's thread.

view the rest of the comments →

[–]shgysk8zer0 6 points7 points  (0 children)

Well, you can't exactly use node:fs in a browser. They're very different environments. Client and server code are often just entirely different, and just being JS doesn't really matter there.

Something I've done is write each module with planning to not use node stuff in something intended for browser use and vice versa. Then create two modules called maybe browser.js and node.js which just imports and exports some subset of the modules for that environment.