14.x Node.js reference

Configuration

Configure the Node.js trust boundary before creating an endpoint. Parser and hot-path handlers are selected once per client or server, not polled for every message.

14.x starter

import ipc from 'node-ipc';

ipc.config.id = 'orders';
ipc.config.silent = true;
ipc.config.parser = 'guarded';
ipc.config.retry = 500;
ipc.config.maxConnections = 100;
Construction is the boundary.

Set profile, limits, TLS, logging, and socket-root policy before connect*() or serve*(). Existing endpoints keep the handlers selected at construction.

Identity and local sockets

KeyDefaultPurpose
idOS hostnameService or process identifier.
appspaceapp.Namespace prefix combined with the socket root and service id.
socketRootPer-user runtime pathUses $XDG_RUNTIME_DIR/node-ipc when available, otherwise an owner-specific temporary directory; Windows uses a per-user logical pipe prefix.
secureSocketRoottrueCreates and verifies an owner-only Unix socket root and is required by Assured. Assured local server endpoints must be direct children; clients must verify endpoint ownership. Other profiles may disable it only when the application owns equivalent checks.
readableAllfalseRequests a local pipe readable by all users or Windows services.
writableAllfalseRequests a local pipe writable by all users or Windows services.
unlinktrueRemoves an existing socket path before binding. Clustered ownership may require false.

Network

KeyDefaultPurpose
networkHost127.0.0.1 or ::1Default TCP, TLS, or UDP host; stays on loopback.
networkPort8000Default network port.
IPTypeDetectedChooses the initial IPv4 or IPv6 loopback default.
maxConnections100Maximum concurrent stream connections.
interfaceAll fields falseOptional localAddress, localPort, family, hints, and lookup socket-connect settings.
tlsfalseTLS options object. Assured clients require key/cert/trusted CA verification; Assured servers require a trusted client CA, requestCert:true, and rejectUnauthorized:true.

Messages and limits

KeyDefaultPurpose
parserfastraw, fast, guarded, assured, or a custom parser class/object. Selected once for each endpoint.
identifyPeerfalseOpt-in legacy server lookup of data.id. Selected once; the caller-supplied value is not authenticated identity.
encodingutf8Encoding for non-Buffer Raw writes. Built-in framed profiles always use UTF-8; custom parsers should return Buffers for another wire encoding.
rawBufferfalseCompatibility switch for Raw. Incoming Buffers pass through the data event with no framing or validation.
delimiter\fFrame terminator for Fast, Guarded, and Assured.
maxMessageSize1048576Guarded/Assured maximum complete or buffered frame bytes.
maxPendingBytes8388608Guarded/Assured maximum queued stream-write bytes before the connection is closed.
maxEventNameLength256Guarded/Assured event-name character limit.
messageTimeout30000Guarded/Assured incomplete-frame deadline in milliseconds; 0 disables it.
allowReservedEventsfalseGuarded-only compatibility escape hatch. Assured always rejects lifecycle names.
allowedEventsfalseRequired non-empty Array or Set for Assured; applied to sent and received event names.
syncfalseQueues client sends until the server replies.

Reconnect policy

KeyDefaultPurpose
retry500 msDelay between stream reconnection attempts.
maxRetriesInfinityMaximum reconnect attempts after a disconnect; 0 disables reconnects.
stopRetryingfalseBoolean switch; true stops scheduled and future reconnect attempts.

Logging

KeyDefaultPurpose
silentfalseDisables library logging when true.
loggerconsole.logReceives one formatted string.
logInColortrueEnables inspected-object colors.
logDepth5Object inspection depth.
logPayloadsfalseSelects payload-aware logging when an endpoint is created. Leave off unless policy permits content logging.
Logs cross trust boundaries.

Leave payload logging off in production unless the data classification and retention policy explicitly allow it.