
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A node.js addon for using POSIX message queues.
node.js -- v0.8.0 or newer
Linux 2.6.6+ or FreeBSD kernel with POSIX message queue support compiled in (CONFIG_POSIX_MQUEUE, which is enabled by default)
man mq_overview for how/where to modify global POSIX message queue resource limitsnpm install pmq
var PosixMQ = require('pmq');
var readbuf, mq;
mq = new PosixMQ();
mq.on('messages', function() {
var n;
while ((n = this.shift(readbuf)) !== false) {
console.log('Received message (' + n + ' bytes): ' + readbuf.toString('utf8', 0, n));
console.log('Messages left: ' + this.curmsgs);
}
this.unlink();
this.close();
});
mq.open({ name: '/pmqtest' });
readbuf = new Buffer(mq.msgsize);
var PosixMQ = require('pmq');
var mq, writebuf, r;
mq = new PosixMQ();
mq.open({
name: '/pmqtest',
create: true,
mode: '0777'
});
writebuf = new Buffer(1);
do {
writebuf[0] = Math.floor(Math.random() * 93) + 33;
} while ((r = mq.push(writebuf)) !== false);
mq.close();
messages() - Emitted every time the queue goes from empty to having at least one message.
drain() - Emitted when there is room for at least one message in the queue.
isFull - boolean - Convenience property that returns true if curmsgs === maxmsgs.
maxmsgs - integer - The maximum number of messages in the queue.
msgsize - integer - The maximum size of messages in the queue.
curmsgs - integer - The number of messages currently in the queue.
(constructor)() - Creates and returns a new PosixMQ instance.
open(<object>config) - (void) - Connects to a queue. Valid properties in config are:
name - string - The name of the queue to open, it MUST start with a '/'.
create - boolean - Set to true to create the queue if it doesn't already exist (default is false). The queue will be owned by the user and group of the current process.
exclusive - boolean - If creating a queue, set to true if you want to ensure a queue with the given name does not already exist.
mode - mixed - If creating a queue, this is the permissions to use. This can be an octal string (e.g. '0777') or an integer.
maxmsgs - integer - If creating a queue, this is the maximum number of messages the queue can hold. This value is subject to the system limits in place and defaults to 10.
msgsize - integer - If creating a queue, this is the maximum size of each message (in bytes) in the queue. This value is subject to the system limits in place and defaults to 8192 bytes.
close() - (void) - Disconnects from the queue.
unlink() - (void) - Removes the queue from the system.
push(< Buffer >data[, < integer >priority]) - boolean - Pushes a message with the contents of data onto the queue with the optional priority (defaults to 0). priority is an integer between 0 and 31 inclusive.
shift(< Buffer >readbuf[, < boolean >returnTuple]) - mixed - Shifts the next message off the queue and stores it in readbuf. If returnTuple is set to true, an array containing the number of bytes in the shifted message and the message's priority are returned, otherwise just the number of bytes is returned (default). If there was nothing on the queue, false is returned.
FAQs
A node.js binding for using POSIX message queues
The npm package pmq receives a total of 3 weekly downloads. As such, pmq popularity was classified as not popular.
We found that pmq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.