Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
local-machine-network
Advanced tools
Provides a local machine network for simple inter-process communication (IPC). Comes in two variants, one for exchanging objects between the leader and client and one for getting the raw sockets.
npm install local-machine-network
const { ObjectNetwork } = require('local-machine-network');
const net = new ObjectNetwork({
path: 'path-to-socket'
});
net.on('leader', () => {
console.log('This instance is the leader!');
});
net.on('connection', other => {
console.log('Incoming connection from someone else:', other);
});
net.on('message', { returnPath, data } => {
console.log('Got a message:', data);
if(data.type === 'request') {
// If type is request send something back
returnPath.send({
type: 'response',
});
}
});
// Connect to the network
net.connect()
.then(() => {
// Send a message to the leader - with any valid JSON
net.send({
type: 'request',
});
})
.catch(handleConnectionError);
const { LowLevelNetwork } = require('local-machine-network');
const net = new LowLevelNetwork({
path: 'path-to-socket'
});
net.on('leader', serverSocket => {
console.log('This instance is the leader!');
// Low-level networks requires the consumer to handle errors
serverSocket.on('error', handleErrorProperly);
});
net.on('connected', socket => {
console.log('Connected to the leader:', socket);
// Low-level networks requires the consumer to handle errors
socket.on('error', handleErrorProperly);
});
net.on('connection', socket => {
console.log('Incoming connection from someone else:', socket);
// Low-level networks requires the consumer to handle errors
socket.on('error', handleErrorProperly);
});
// Connect to the network
net.connect()
.then(...)
.catch(handleConnectionError);
FAQs
Create a machine local network with leader election
The npm package local-machine-network receives a total of 5 weekly downloads. As such, local-machine-network popularity was classified as not popular.
We found that local-machine-network 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.