{"size": 372, "ext": "js", "max_stars_repo_path": "pluralsight/node/advanced/8.7/server.js", "max_stars_repo_name": "kwr760/learning", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "pluralsight/node/advanced/8.7/server.js", "max_issues_repo_name": "kwr760/learning", "max_issues_repo_issues_event_min_datetime": "2020-07-18T22:02:05.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-13T01:27:02.000Z", "max_forks_repo_path": "pluralsight/node/advanced/8.7/server.js", "max_forks_repo_name": "kwr760/learning", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 20, "max_forks_count": null, "avg_line_length": 21.8823529412, "max_line_length": 49, "alphanum_fraction": 0.6155913978}
const http = require('http');
const pid = process.pid;

let usersCount;

http.createServer((req, res) => {
  for (let i=0; i<1e7; i++); // simulate CPU work
  res.write(`Handled by process ${pid}\n`);
  res.end(`Users: ${usersCount}`);
}).listen(8080, () => {
  console.log(`Started process ${pid}`);
});

process.on('message', msg => {
  usersCount = msg.usersCount;
});
