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
| Key | Default | Purpose |
|---|---|---|
id | OS hostname | Service or process identifier. |
appspace | app. | Namespace prefix combined with the socket root and service id. |
socketRoot | Per-user runtime path | Uses $XDG_RUNTIME_DIR/node-ipc when available, otherwise an owner-specific temporary directory; Windows uses a per-user logical pipe prefix. |
secureSocketRoot | true | Creates 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. |
readableAll | false | Requests a local pipe readable by all users or Windows services. |
writableAll | false | Requests a local pipe writable by all users or Windows services. |
unlink | true | Removes an existing socket path before binding. Clustered ownership may require false. |
Network
| Key | Default | Purpose |
|---|---|---|
networkHost | 127.0.0.1 or ::1 | Default TCP, TLS, or UDP host; stays on loopback. |
networkPort | 8000 | Default network port. |
IPType | Detected | Chooses the initial IPv4 or IPv6 loopback default. |
maxConnections | 100 | Maximum concurrent stream connections. |
interface | All fields false | Optional localAddress, localPort, family, hints, and lookup socket-connect settings. |
tls | false | TLS 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
| Key | Default | Purpose |
|---|---|---|
parser | fast | raw, fast, guarded, assured, or a custom parser class/object. Selected once for each endpoint. |
identifyPeer | false | Opt-in legacy server lookup of data.id. Selected once; the caller-supplied value is not authenticated identity. |
encoding | utf8 | Encoding for non-Buffer Raw writes. Built-in framed profiles always use UTF-8; custom parsers should return Buffers for another wire encoding. |
rawBuffer | false | Compatibility switch for Raw. Incoming Buffers pass through the data event with no framing or validation. |
delimiter | \f | Frame terminator for Fast, Guarded, and Assured. |
maxMessageSize | 1048576 | Guarded/Assured maximum complete or buffered frame bytes. |
maxPendingBytes | 8388608 | Guarded/Assured maximum queued stream-write bytes before the connection is closed. |
maxEventNameLength | 256 | Guarded/Assured event-name character limit. |
messageTimeout | 30000 | Guarded/Assured incomplete-frame deadline in milliseconds; 0 disables it. |
allowReservedEvents | false | Guarded-only compatibility escape hatch. Assured always rejects lifecycle names. |
allowedEvents | false | Required non-empty Array or Set for Assured; applied to sent and received event names. |
sync | false | Queues client sends until the server replies. |
Reconnect policy
| Key | Default | Purpose |
|---|---|---|
retry | 500 ms | Delay between stream reconnection attempts. |
maxRetries | Infinity | Maximum reconnect attempts after a disconnect; 0 disables reconnects. |
stopRetrying | false | Boolean switch; true stops scheduled and future reconnect attempts. |
Logging
| Key | Default | Purpose |
|---|---|---|
silent | false | Disables library logging when true. |
logger | console.log | Receives one formatted string. |
logInColor | true | Enables inspected-object colors. |
logDepth | 5 | Object inspection depth. |
logPayloads | false | Selects 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.