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

updated-node-msmq-hsd

v0.2.2

Published

A MSMQ implementation for node.js

Readme

updated-node-msmq

This is a fork of node-msmq providing improvements and additional functionality which are not yet added into the main node-msmq repo.

NPM package is published as updated-node-msmq. https://www.npmjs.com/package/updated-node-msmq.

A MSMQ implementation for node.js

Differences from node-msmq

  • Support for Node.Js 6.x, 7.x, 8.x, 9.x, 10.x
  • Support to push objects to the queue instead of just strings.
  • Support to send/receive messages to/from a queue on a remote machine.

Install

$ npm install --save updated-node-msmq

Usage (Local Queue)

Send a message

Sends a message to a MSMQ queue.

const msmq = require('updated-node-msmq');

var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');

// Send message to queue
queue.send('Hello from Node.JS!');

Receive messages

Start receiving messages from a queue.

const msmq = require('updated-node-msmq');

var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');

// Set receive listener callback
queue.on('receive', (msg) => {
  console.log(msg.body);
});

// Start receiving messages from the queue
queue.startReceiving();

Peek messages

Start listeng for messages without removing them until you are ready to do so. Callbacks for the 'peek' event receive an object containing two properties:

  • msg The MSMQ Message.
  • next() Pops the message from the queue and start peeking for the next one.
queue.on('peek', (event) => {
  console.log(event.msg.body);

  // Do some logic that might fail.
  if (Math.random() > 0.5) {
    throw Error('number is too high!');
  }

  // Remove the message from the queue and peek for next message.
  event.next();
})

queue.startPeeking();

Peek

Promised based method to peek for a message in the queue without removing it. Resolves to a MSMQMessage.

queue.peek().then(msg => console.log(msg.body));

//or

let msg = await queue.peek();

Remove

Promise based method to remove a message with given id from the queue. Resolves to true if message was removed and false if message didn't exist in the queue.

queue.remove('12345')
     .then(status => console.log(status ? 'Message was removed'
                                        : 'Message was not in queue'));

//or

let status = await queue.remove('12345');

Get all messages

Gets all messages without removing them from queue.

const msmq = require('updated-node-msmq');

var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
var messages = queue.getAllMessages();

Purge a queue

Clears all messages from the queue.

const msmq = require('updated-node-msmq');

var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
queue.purge();

Usage (Remote Queue)

Send a message to a remote queue

Sends a message to a remote MSMQ queue.

const msmq = require('updated-node-msmq');

// Send message to a remote queue using hostname
let queue1 = msmq.connectToRemoteQueue('FormatName:DIRECT=OS:mobile-000000\\private$\\privatetest');

queue1.send('Hello again from Node.JS!');

// Send message to a remote queue using IP address
let queue2 = msmq.connectToRemoteQueue('FormatName:DIRECT=TCP:192.168.5.21\\private$\\privatetest');

queue2.send('Hello again from Node.JS!');

Receive messages from a remote queue

Start receiving messages from a remote queue.

const msmq = require('updated-node-msmq');

var queue = msmq.connectToRemoteQueue('FormatName:DIRECT=OS:mobile-000000\\private$\\privatetest');

// Set receive listener callback
queue.on('receive', (msg) => {
  console.log(msg.body);
});

// Start receiving messages from the queue
queue.startReceiving();

Get all messages

Gets all messages without removing them from a remote queue.

const msmq = require('updated-node-msmq');

var queue = msmq.connectToRemoteQueue('.\\Private$\\MyAwesomeQueue');
var messages = queue.getAllMessages();

Note:

  • Creating a queue / Checking if a queue exists on a remote machine is currently not supported by MSMQ.

  • To communicate with a remote queue, MSMQ should be enabled in the sender's machine too. Also, in the Security tab of the queue on the remote machine should have the appropriate permissions set for Everyone and ANONYMOUS LOGON.

  • The queue should already be created on the remote machine.

  • The format to connect to a remote queue is as follows: msmsq.connectToRemoteQueue(path);

  • path has to be in the following format:

    FormatName:DIRECT=TCP:<ip_address>\\private$\\<queue_name>`

    or

    FormatName:DIRECT=OS:<machine_name>\\private$\\<queue_name>`

License

MIT © Joel Menezes