Question: How can you count the number of logical CPUs on the machine that is running Node?

  1. node -p "process.cpus"
  2. node -p "util.cpus().size"
  3. node -p "process.os.cpus"
  4. node -p "os.cpus().length"

Answer: The correct answer of the above question is Option D:node -p "os.cpus().length"