Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
conn-wrapper
Advanced tools
A simple wrapper for connections which only allows passing string.
There are a lots of times communication through connections and processes require dynamic Event Emitter rather than only listening on message
event. This module allows dev to create events dynamicly through those connections.
npm install --save conn-wrapper
const cp = require('child_process');
const child = cp.fork(path.join('./child.js'));
child.on('message', function(message) {
m = JSON.parse(message);
if (m.event === 'event1') {
// Do something
} else if (m.event === 'event2') {
// Do something
} else if (m.event === 'event2') {
...
}
...
})
const ConnWrapper = require('conn-wrapper');
const cp = require('child_process');
const child = cp.fork(path.join('./child.js'));
const wrapper = ConnWrapper(child);
// Send event
wrapper.send('event', payload)
// Listen for an event
wrapper.on('event1', function(payload) {
// Do something
});
To achieve this, the message
sent by conn.send()
must be a json or json format string. All other type will be ignored.
The message has 2 fields: event
(name of the event to be listened on) and body
(optinal, main content).
Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. Feel free to learn more about him.
Yeoman and Generator-simple-package
MIT © nghiattran
FAQs
A wrapper for connections which only allows passing string.
We found that conn-wrapper 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.