There are now several forks of nodejs for various reasons.
For my node code to see which fork it is running under, what is currently the best way?
The forks I am aware of are:
- The official nodejs release
- iojs - I guess it's now deprecated since it's rejoined the official nodejs, but it's still of interest
- JXcore - a fork that supports multiple CPUs/core; multiple JS engines including V8, Mozilla's SpiderMonkey, and Microsoft's ChakraCore; and packaging of js apps so npm doesn't need to be used by users of the apps
- Microsoft's fork of nodejs using their Edge browser's ChakraCore JS engine via a V8-compatibility shim
(I've also asked a companion question about detecting which JS engine is being used. This question is only about detecting which fork is being used.)
NodeJS and iojs can be probably checked by process.release :
As for JXcore you can use either
process.jxversion
ortypeof jxcore !== 'undefined'