1.0.2 • Published 7 years ago
100pourcent v1.0.2
100pourcent.js
Allow NodeJS to use all CPU's cores
That's really easy to use. That's my base code who can use only 1 core of my CPU :
const http = require('http');
http.createServer((req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
use NPM to install the 100pourcent
module :
npm i 100pourcent
edit the code to require the module and pass our code in argument, in a function :
require("100pourcent")(()=>{
const http = require('http');
http.createServer((req, res) => {
res.writeHead(200);
res.end('hello world\n');
}).listen(8000);
});
Then our app can use 100% of the CPU cores