
node-ipc

node-ipc 14.0.0 source for the aligned npm, NuGet, and crates.io release
Fast local and remote process communication for Node.js, C#, and Rust on Linux,
macOS, and Windows. The aligned implementations share the normal node-ipc event
envelope and delimiter framing across local sockets, TCP, and UDP.
A great solution for complex multiprocess Neural Networking in Node.JS
npm install --save-exact node-ipc@14.0.0
Rust: cargo add node-ipc@14.0.0 --exact
C#: dotnet add package node-ipc --version 14.0.0
Use an exact, reviewed version. Do not use a mutable tag or version range for security-sensitive deployments.
Runtime
Version 14 requires Node.js 22.13.0 or newer. The native ports require Rust
1.85 or newer and .NET 8 or newer. Version 12 remains the legacy Node release
line; version 13 was never published.
node-ipc ships native ES modules only. Node.js loads the same entry point through import or synchronous require(); no transpiled CommonJS bundle is generated.
The node-ipc JavaScript package is Node.js-only. It uses Node's raw TCP,
TLS, UDP, Unix-domain socket, Windows named-pipe, filesystem, OS, process, and
Buffer APIs. It is not supported in browsers, with or without a bundler.
“Native ESM” means that Node loads the one JavaScript implementation without a
transpiler; it does not mean native-browser ESM. The documentation website's
browser code is separate and is not part of the npm package runtime.
Node.js runtime profiles
The Node.js implementation selects its parser and hot-path handlers once, when each client or server is created. It does not poll a security flag for every message. Set the profile before calling connect*() or serve*().
| Profile |
Work on every message |
Intended boundary |
raw |
No node-ipc framing, JSON parsing, or message checks. Buffers pass through the data event. |
Trusted peers using a caller-owned binary or text protocol. |
fast |
JSON event-envelope encoding/decoding and delimiter framing. Malformed JSON becomes a protocol error; stream connections close. |
Default for trusted local peers where the application owns payload validity. |
guarded |
Fast framing plus frame-size, stream pending-write, event-name, reserved/prototype-name, envelope, and incomplete-message-time controls. |
Mixed-trust local services and authenticated network applications. |
assured |
Guarded controls plus a required event allow-list. Network use requires mutually authenticated TLS; each Unix local server endpoint must be a direct child of the secure socket root. Built-in Windows local service is rejected because node-ipc cannot prove its named-pipe ACL. |
Hostile-network building block with verified peer certificates and application authorization; not a certification. |
ipc.config.parser = 'guarded';
ipc.config.maxMessageSize = 1024 * 1024;
ipc.config.maxPendingBytes = 8 * 1024 * 1024;
These transport guarantees are Node.js-specific. Rust shares the four codec
profiles but requires the caller to establish and verify the transport boundary.
See Profiles, Parsers, and Security before choosing a network-facing configuration.
Rust
The paired Rust crate requires Rust 1.85 or newer and has no runtime or build
dependencies. Its sole development dependency is exact vanilla-test 2.1.0.
use node_ipc::{tcp, CodecConfig, Connection, Event};
fn main() -> node_ipc::Result<()> {
let stream = tcp::connect(("127.0.0.1", 9763))?;
let mut connection = Connection::new(stream, CodecConfig::fast())?;
connection.send(&Event::new("app.message", "hello"))?;
Ok(())
}
Rust supplies TCP, UDP, Unix-domain sockets, Windows named pipes, raw bytes,
and the Fast, Guarded, and Assured codecs. Applications supply their own
verified TLS stream; the crate does not choose or reimplement cryptography.
See the Rust engineer guide
and native examples.
C\
The aligned C# package targets .NET 8, has no NuGet dependencies, and mirrors
the JavaScript facade: IPCModule, config, of, server, serve*,
connect*, event subscriptions, targeted emit, and broadcast. It supplies
async TCP, TLS, UDP4/UDP6, Unix-domain sockets, Windows named pipes, Raw, Fast,
Guarded, Assured, reconnect, and sync request queues.
using NodeIpc;
await using var ipc = new IPCModule();
ipc.config.silent = true;
var client = ipc.connectToNet("service", "127.0.0.1", 9763)!;
await client.waitForConnectAsync();
await client.emitAsync("app.message", new { text = "hello" });
See the C# package guide
and native examples.
Use
ESM: import ipc from 'node-ipc';
CommonJS: const ipc = require('node-ipc').default;
CommonJS loading uses Node.js 22.13+'s native require(esm) support.
NPM Stats
npm info : See npm trends and stats for node-ipc\
\

GitHub info :\

Code Coverage Info :\
Run npm run coverage to host a local version of the coverage report on 127.0.0.1:8080.
Testing done with vanilla-test\
vanilla-test provides native V8 coverage for the ESM test suite without transpilation or bundling.
Package details websites :
This work is licenced via the MIT Licence.
Testing
npm test runs 195 Node correctness cases, native V8 coverage, both module
loaders, installed-package smoke, and benchmark validation. Reports are written
to coverage/node/.
cargo test --manifest-path rust/node-ipc/Cargo.toml --all-targets runs the 38
Rust-native VanillaTest cases. node rust/node-ipc/interop/vanilla-test.js runs
the separate two-direction Node/Rust interoperability gate.
dotnet run --project csharp/node-ipc/tests/NodeIpc.Tests -c Release runs the
exact C# native case inventory. node csharp/node-ipc/interop/vanilla-test.js
runs the separate two-direction Node/C# interoperability gate, and
pwsh -File csharp/node-ipc/package-smoke.ps1 validates the NuGet boundary.
npm run test:behavioral runs the shared black-box Fast TCP transcript across
all nine JavaScript, Rust, and C# server/client pairings. Seven pipelined
payload-shape and ordering cases must pass before a separate finish handshake
and two-sided clean stream boundary in every pair, including both Rust/C#
directions. Each native encoder also has to match one canonical Fast frame byte
for byte. This gate makes no performance assertions; the deeper
language-specific profile and transport checks remain in their native suites.
The same command adds 12 raw fault-injection cases: each language, in both
client and server roles, must reject complete and incomplete frames after the
finish boundary. Together with the nine positive pairings, the behavioral gate
contains 21 cases.
Performance evidence
The chart is generated from tracked, clean profile runs. Results stay separated by operating system, architecture, Node version, compiler, and commit; Assured remains pending until comparable mTLS evidence passes the same gates. See the benchmark overview, profile results, resource results, methodology, and run records.
Version 12 versus tracked transport cohorts
The accepted 2692d32 CI cohort reports median time for 1,000,000 completed messages through native local IPC, TCP, TLS, UDP4, and UDP6 on Windows, macOS, and Linux with Node.js 22.13.0 and 24.18.1. v14.0.0 was faster than v12.0.0 in all 30 exact environment/transport pairs, with paired median speedups from 1.14× to 4.96×. Local IPC, TCP, and TLS use the Node byte reflector; UDP4 and UDP6 use the standard-C exact-count reflector. Both versions use the same oracle within every pair, and C-oracle source, binary, compiler, flags, target provenance, exact counts, and cleanup are retained. TLS is an encryption-only throughput lane with peer verification disabled and its handshake outside timing. Hosted results remain grouped by operating system, Node version, and transport; they are directional snapshots, not a universal ranking. See the transport comparison, raw manifest, and accepted workflow run.
Node.js and Rust TCP
The accepted 2692d32 hosted-runner batch used Node.js 24.18.1 and Rust 1.85.0.
Fixed lane order is Node→Node / Node→Rust / Rust→Node / Rust→Rust: Linux measured
10,312 / 9,317 / 16,816 / 12,478 ms, macOS 7,817 / 7,368 / 8,165 / 5,596 ms,
and Windows 12,609 / 15,231 / 23,186 / 13,070 ms per 1,000,000 validated round
trips. One round trip is two application frames. Each full sample also uses
100,000 warm-up round trips, a 64-byte payload, 64 maximum requests in flight,
release-built Rust, fresh peers, a fresh loopback port, and exact cleanup.
Hosted platforms have different hardware; this is fixed-order evidence, not a
cross-platform ranking. See the engineer benchmark page,
raw manifest,
or run npm run benchmark:rust:quick for a non-publishable four-lane smoke.
Contents
- Types of IPC Sockets and Supporting OS
- IPC Config
- IPC Methods
- log
- connectTo
- connectToNet
- disconnect
- serve
- serveNet
- IPC Stores and Default Variables
- IPC Events
- Multiple IPC instances
- Basic Examples
- Server for Unix||Windows Sockets & TCP Sockets
- Client for Unix||Windows Sockets & TCP Sockets
- Server & Client for UDP Sockets
- Raw Buffers, Real Time and / or Binary Sockets
- Working with TLS/SSL Socket Servers & Clients
- Node Code Examples
Types of IPC Sockets
| Type |
Stability |
Definition |
| Unix socket or Windows named pipe |
Stable |
Local IPC without the TCP/IP stack. Measure it against TCP on the target system rather than assuming a fixed latency difference. Local Unix socket and Windows named-pipe examples |
| TCP Socket |
Stable |
Reliable ordered byte streams for local loopback or remote networks. Local or remote TCP examples |
| TLS Socket |
Stable |
Encrypted network socket. It is secure only when certificate identities are verified; use mTLS or application authentication when clients must be identified. TLS documentation |
| UDP Sockets |
Stable |
Unordered datagrams for workloads that can own loss, duplication, reordering, and authentication. Compare measured latency and throughput on the target network before choosing it over TCP or local IPC. Local or remote UDP examples |
| OS |
Supported Sockets |
| Linux |
Unix, Posix, TCP, TLS, UDP |
| Mac |
Unix, Posix, TCP, TLS, UDP |
| Win |
Windows, TCP, TLS, UDP |