1.0.3 • Published 7 years ago

bonzai v1.0.3

Weekly downloads
12
License
-
Repository
-
Last release
7 years ago

bonzai

Node.js easy cluster module

Simple usage

You can install it using NPM with this command:

npm i --save bonzai

And then call it

var bonzai = require('bonzai')

bonzai({
    workerCount: 1,
    workerFunc: function() {
        //
    },
    autoSpawn: true,
    logging: true
})

Express example

function server() {
    var express = require('express')
    var app = express()

    app.get("/", function(req, res) {
        res.send("It works")
    })

    app.listen(3333)
}

var bonzai = require('bonzai')

bonzai({
    workerCount: 1,
    workerFunc: server,
    autoSpawn: true,
    logging: true
})

Options

VariableTypeDefault
workerCountintegercpu count
workerFuncfunction
autoSpawnbooleantrue
loggingbooleanfalse
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago