Pick one small pattern

Examples

Open only the transport and behavior you need. These are the 14.x Node.js examples; native Rust examples have their own focused page.

Run these with Node.js.

The node-ipc JavaScript package is Node.js-only and does not run in web browsers, whether bundled or unbundled. These examples use native process and socket APIs; they are not browser examples.

By transport

TLS

Certificate configurations from local development through mutual authentication patterns.

Browse TLS examples →

Native Rust

Use the matching TCP, UDP, Unix/Windows, TLS-boundary, cluster, and Node/Rust interoperability examples.

Open Rust examples →

By message pattern

Basic request / reply

Start with one client event and one server response. It is the clearest place to add validation and authorization.

ipc.server.on('request', (data, socket) => {
  ipc.server.emit(socket, 'response', handle(data));
});

Multi-client broadcast

Fan one event out to known sockets. Do not broadcast secrets or tenant-specific data.

ipc.server.on('notice', data => {
  ipc.server.broadcast('notice', data);
});

Raw buffers

Skip event framing for binary protocols or interoperability with non-Node peers.

ipc.config.rawBuffer = true;
ipc.config.encoding = 'utf8';
ipc.server.on('data', (buffer, socket) => {});

Synchronous queue

Queue new client sends until the current request receives data from the server.

ipc.config.sync = true;
ipc.of.worker.emit('job', payload);

Before copying