npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@paddor/omq-node

v0.2.2

Published

Native Node.js binding for OMQ.rs

Readme

OMQ.node

Native Node.js binding for OMQ.rs.

It wraps omq-tokio, so routing, reconnect, fair-queueing, auth, compression, and transport I/O run in OMQ-owned background threads while Node code gets a small API built around Context, typed sockets, Message, Buffer, and Promise.

This package is for Node main/server processes. Browser code should use @zeromq/omq.

2-process loopback PUSH/PULL throughput and REQ/REP p50 latency: per-message OMQ.node sync API calls vs per-message zeromq.js calls over TCP.

Highlights

  • Native OMQ engine shared with OMQ.rs.
  • High-throughput tcp://, native ipc://, and inproc:// messaging.
  • Compression transports and static LZ4 dictionaries.
  • PLAIN and CURVE security.
  • Explicit native context sharing for inproc:// across Node handles.
  • TypeScript definitions and typed socket classes.

Build, install, test

Requires Node 24.11 or newer.

npm install
npm run build
npm test

The native addon builds through NAPI and loads from omq_node.node during local development. Published packages can load a matching platform prebuild.

API Shape

  • Context owns native IO threads and creates sockets.
  • Context.shareKey() / Context.fromShareKey(...) explicitly share one native context core and inproc:// namespace across Node handles.
  • SocketOptions are passed at socket creation before transport I/O starts.
  • Socket supports async send / recv, sync hot paths, recvManySync, and async iteration.
  • Message is immutable and supports single-part and multipart payloads.
  • Typed socket classes cover Req, Rep, Pub, Sub, XPub, XSub, Push, Pull, Dealer, Router, Pair, Client, Server, Radio, Dish, Scatter, Gather, Channel, Peer, and Stream.
  • Sub exposes subscribe / unsubscribe; Dish exposes join / leave.
  • Sockets are single-thread objects on the JavaScript side; create more sockets for more concurrent flows.

OMQ.node is not a zeromq.js compatibility layer. It follows ZMQ socket semantics, but exposes a Node API shaped around this binding.

Example:

const { Pull, Push } = require("@paddor/omq-node");

async function main() {
  const pull = new Pull();
  const push = new Push();

  try {
    const endpoint = await pull.bind("tcp://127.0.0.1:0");
    await push.connect(endpoint);
    await push.send("hello");
    console.log((await pull.recv()).string());
  } finally {
    push.close();
    pull.close();
  }
}

main();

Shared inproc:// context:

const { Context, Pull, Push } = require("@paddor/omq-node");

async function main() {
  const owner = new Context();
  const shared = Context.fromShareKey(owner.shareKey());
  const pull = new Pull({}, owner);
  const push = new Push({}, shared);

  try {
    await pull.bind("inproc://example");
    await push.connect("inproc://example");
    await push.send("hello");
    console.log((await pull.recv()).string());
  } finally {
    push.close();
    pull.close();
    shared.close();
    owner.close();
  }
}

main();

Socket options:

const { Push } = require("@paddor/omq-node");

async function main() {
  const push = new Push({
    sendHighWaterMark: 10_000,
    lingerMs: 0,
    workloadProfile: "throughput",
  });

  await push.connect("tcp://127.0.0.1:5555");
}

main();