Shared Memory Packet Interface (memif) for Node.js

This package is a Node C++ addon of libmemif, which provides high performance packet transmit and receive between Node.js and VPP/DPDK applications.
It works on Linux only and requires libmemif installed at /usr/local/lib/libmemif.so
.
API Example
const { Memif } = require("memif");
const memif = new Memif({
role: "client",
socketName: "/run/memif.sock",
id: 0,
dataroom: 2048,
ringCapacity: 1024,
});
memif.on("data", (pkt) => {
});
memif.send(Uint8Array.of(0x01, 0x02));
memif.close();
Limitations
Each Memif
instance must have a distinct socketName
.
MEMIF_BUFFER_FLAG_NEXT
is not supported.