use-max-cpu

2.0.0 • Public • Published

use-max-cpu NPM version Build Status Dependency Status Coverage percentage

A single instance of Node.js runs in a single thread. To take advantage of multi-core systems, the user will sometimes want to launch a cluster of Node.js processes to handle the load.

Installation

$ npm install --save use-max-cpu

Usage

const {startServer} = require('use-max-cpu');
const http = require('http');
 
startServer(() => {
    console.log('Worker started..')
    http.createServer((req, res) => {
        res.writeHead(200);
        res.end('hello world\n');
      }).listen(8000);
})

License

MIT © Boris Joskic

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i use-max-cpu

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    4.52 kB

    Total Files

    5

    Last publish

    Collaborators

    • brsjsk