fork download
  1. var cluster = require("cluster");
  2. var OS = require("os");
  3. var ReadLine = require("readline");
  4.  
  5. if (cluster.isMaster) {
  6. var numCPUs = OS.cpus().length;
  7. for (var i = 0; i < numCPUs; i++)
  8. cluster.fork();
  9. var rl = ReadLine.createInterface({
  10. "input": process.stdin,
  11. "output": process.stdout
  12. });
  13. rl.on("line", function(line) {
  14. console.log(line);
  15. });
  16. } else {
  17. //do stuff
  18. }
Runtime error #stdin #stdout #stderr 0.01s 30424KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.js:1:0 ReferenceError: require is not defined