>
If I have a bunch of node code, can I execute it in C# from the command line on a linux box without changing the code at all?No, C# is a different language. The syntax should be familiar to someone who has written JavaScript (especially TypeScript), Java, or any C-like language.
> Also the async/await stuff doesn't really make node synchronous, because you still have to wrap your await in an asynchronous function.
No, you don't[1].
But even when you did, what's the difference to you? You can just wrap all the way up to the top level. The node CLI doesn't care if it's executing a top-level async function or not. You could have async/await syntax available to every line of code you write.
> I'm just wondering what the process would be to "disable" the asynchronous behaviour of nodejs and make everything blocking by default
Part of the reason Node has asynchronous* behavior is because it's part of the ECMAScript standard.
So to answer your question, to disable the asynchronous code, you would have to either:
A) Stop using any libraries that use callbacks or return promises
B) Stop using JavaScript
That's why I suggested C#. It doesn't make sense to say, "How hard would it be to change this fundamental design decision in this language?"
If you don't like it, just use another language. Or use the built-in syntactical sugar (async/await) that make it feel like a synchronous language.
1. https://pprathameshmore.medium.com/top-level-await-support-i...
* I am aware that JavaScript is single-threaded and blocking, but I'm using "asynchronous" as shorthand for "programming in an asynchronous style".