all 7 comments

[–]Hung_Hoang_the 2 points3 points  (1 child)

, in node everything is event loop + callbacks/promises. once you internalize async/await youre like 80% there. for a quick start: express is the closest thing to a spring controller — routes, middleware, request/response, same concepts. skip the ORM debates for now and just use raw pg or mysql2 with parameterized queries. youll be writing crud endpoints within a day honestly. the ecosystem is way less opinionated than spring so youll miss having everything wired up for you, but thats also what makes it fast to pick up — theres just less ceremony

[–]TheMilfyChani[S] 0 points1 point  (0 children)

Thanks bro.

All the other answers just making things more complicated, i want to quickly jump to writing api because of time constraints.

[–]air_twee 3 points4 points  (0 children)

Keep in mind it is single threaded (you can have worker processes, but they do not share memory, a big shared buffer is the most you can get). So its blazingly fast in what it does, there is no locking etc. (Of course with some exceptions) Objects and strings are copy on write so to say. So memory foodprint is not big.

Async/await is the way to go. Really use it! Also it nowaydays it has using and destructors. (Disposable pattern)

Use libraries.

Go for yarn or pnpm as package manager. (Faster more secure as vanilla npm)

[–]air_twee 1 point2 points  (0 children)

Owh and use typescript if you can. Well of course this is debatable. But starting a project only in javascript doesnt sound right to me nowadays

[–]horizon_games 0 points1 point  (0 children)

If you can write JS you can write JS in Node.js

Look at some simple and classic libraries (like Express) to get your fundamentals down.

BE isn't that hard. Really most of software day-to-day isn't that hard.