1.2.3 • Published 3 years ago

shared-node-buffer v1.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

shared-node-buffer

Node shared buffer class for fast sharing data between processes (Windows/OSX/Linux supported).

linux ci osx ci windows ci

About

The SharedNodeBuffer class library provides Node.js class that utilise memory mapped files for fast low-level inter-process communication (IPC).

Install

> npm install shared-node-buffer --save

Example

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());
}

API

SharedNodeBuffer proxys the most Buffer.prototype's method, you can find at Node.js Buffer Doc.

1.2.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago