|
|
|
|
|
by excursionist
2378 days ago
|
|
JS in Node and JS in browser is not that different. It's the same language, using the same JavaScript engine (v8 for chrome). The difference is in the APIs provided by Node vs Browser, which is pretty minor. Many popular JS libraries will run in Node just as well as Browser. That being said, JS is a pretty shit language and I don't know why anyone would want to use it for backend work. |
|
These days my main strategy is to have three TypeScript projects—frontend, backend, and common. I then whitelist imports in the common libraries.
> It's the same language, using the same JavaScript engine (v8 for chrome).
I find it completely unacceptable to assume that V8 is running in the browser. In general, I do all of my JS development work in Firefox or Safari, and this saves me a bunch of time checking portability later.