11cb0ef41Sopenharmony_ciconst cluster = require('cluster'); 21cb0ef41Sopenharmony_ciif (cluster.isPrimary) { 31cb0ef41Sopenharmony_ci cluster.fork(); // one child 41cb0ef41Sopenharmony_ci cluster.on('exit', function(worker, code, signal) { 51cb0ef41Sopenharmony_ci console.log(`worker terminated with code ${code}`); 61cb0ef41Sopenharmony_ci }); 71cb0ef41Sopenharmony_ci} 8