demographic
v1.0.1
Published
A cluster management API for NodeJS
Downloads
5
Maintainers
Readme
Demographic
A cluster management API for NodeJS
Installation
npm install demographic --save
Basic Usage
import * as os from "os";
import * as cluster from "cluster";
import * as demographic from "demographic";
if (cluster.isMaster) {
demographic.spawn(os.cpus().length)
.then((worker) => {
})
.catch((err) => {
// handle error
})
} else {
const app = require("./app");
app.listen(8080);
}