Edit: as @dystroy notes below, node uses machine code directly, not bytecode.
I do a lot of Python coding, and there's always bytecode lying around in .pyc files.
I was wondering if node stores its machine code in similar files, eg it would make sense to keep the machine code representation around on disk and re-use it if a file's source is unchanged.
If so, where does node/v8 store this machine code?
Edit 2: As @dystroy mentions below this is a dupe of How can I see the machine code generated by v8?
V8 is a just in time compiler. So JavaScript cannot be compiled just once like python compiler which is static compilation. It is compiled as and when it needs to be executed.
You cannot see the generated machine code for JavaScript, because it is not stored. It does not make sense to store the machine code that was compiled, as compilation happens repeatedly and is affected by runtime optimisations. You don't get fixed machine code like for python, every time it happens.
From the project's page :
V8 compiles JavaScript source code directly into machine code when it is first executed. There are no intermediate byte codes, no interpreter.
That's why you won't find the bytecode, there is none.
Regarding the new question following your edit, I think this related question answers it mostly. Of course there's no reason in general for V8 to write the machine code on disk with the default setup. As this code changes a lot (see the link above, explaining how dynamic classes are created), that would be a gigantic overhead.