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.
@braintree/event-emitter
Advanced tools
A helper module for creating objects with event emitter capabilities.
npm
npm install --save @braintree/event-emitter
This module uses commonjs. You must use a build tool such as Browserify or Webpack to include it in your frontend project.
var EventEmitter = require("@braintree/event-emitter");
function MyClass() {
EventEmitter.call(this);
}
MyClass.prototype = EventEmitter.createChild(MyClass);
var obj = new MyClass();
obj.on("event-name", function (data) {
console.log("called with", data.payload, "!");
});
obj._emit("event-name", { payload: "foo" }); // logs "called with foo!"
var obj = new MyClass();
var cb = function () {};
obj.on("event-name", cb);
obj.off("event-name", cb);
obj._emit("event-name", { payload: "foo" }); // cb is not called
npm test
0.4.0
FAQs
A simple event emitter.
The npm package @braintree/event-emitter receives a total of 267,578 weekly downloads. As such, @braintree/event-emitter popularity was classified as popular.
We found that @braintree/event-emitter demonstrated a healthy version release cadence and project activity because the last version was released less than 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.