Skip to content

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

License

Notifications You must be signed in to change notification settings

ErosZy/shared-node-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shared-node-buffer

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

linux ci osx ci windows ci Version License

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published