Node shared buffer class for fast sharing data between processes (Windows/OSX/Linux supported).
The SharedNodeBuffer class library provides Node.js class that utilise memory mapped files for fast low-level inter-process communication (IPC).
> npm install shared-node-buffer --save
const cluster = require("cluster");
const SharedNodeBuffer = require("shared-node-buffer");
const buffer = new SharedNodeBuffer("your key", 1024 * 1024);
if (cluster.isMain) {
buffer.write("Hello World!");
cluster.fork();
} else {
console.log(buffer.slice(0, 64).toString());
}
SharedNodeBuffer proxys the most Buffer.prototype's method, you can find at Node.js Buffer Doc.