There are now several forks of nodejs and some of them support JavaScript engines other than Google's V8 engine.
For my node code to see which JS engine it is running under, what is currently the best way?
The engines I am aware of are:
- Google's V8 - The only engine supported by the official node.js and the iojs fork. One of the engines supported by JXcore.
- Mozilla's SpiderMonkey - One of the engines supported by JXcore.
- Microsoft's ChakraCore - The engine supported by Microsoft's port of node.js and apparently one of the engines supported by JXcore though I haven't got that one to work yet.
(I've asked a separate question about detecting which fork of nodejs is being used. This question is only about detecting the JS engine.)
process
andversions
objects actually have fields different between nodejs ports. I want to document the differences in an answer but so far I can't compare MS's nodejs with ChakraCore against JXcore with Chakra as I can't find out how to use the latter on Windows 7. – Cadmium