The event-driven Node.js surface stays small. Profile selection and parser construction happen before a client or server enters its message path.
Node.js-only JavaScript API.
The imports below load raw Node TCP, TLS, UDP, local-socket, filesystem, OS, process, and Buffer APIs. They do not run in web browsers, whether bundled or unbundled; no browser entry is published.
Imports and instances
import ipc, {IPCModule} from 'node-ipc';
// Shared singleton
ipc.config.id = 'primary';
// Independent configuration, clients, and server
const secondary = new IPCModule();
secondary.config.id = 'secondary';
Instance isolation
Each IPCModule owns its own config, of client store, and server reference.
Parser exports
import {
RawParser,
FastParser,
GuardedParser,
AssuredParser,
IPCProtocolError
} from 'node-ipc';
import {createParser} from 'node-ipc/parsers';
import MessageParser from 'node-ipc/parsers/message';
Parser remains an alias of FastParser. MessageParser is an opt-in js-message compatibility parser, not a hardened decoder. See the parser contract.
Stores
Property
Value
Meaning
ipc.config
Defaults object
Configuration copied into new clients and servers.
ipc.of
Object
Connected or connecting clients keyed by service id.
ipc.server
Server or false
The server created by the latest serve* call.
Connect
connectTo(id[, path][, callback])
Creates a Unix-domain or Windows named-pipe client and stores it at ipc.of[id]. The default path is socketRoot + appspace + id.