Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@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.
import EventEmitter from "@braintree/event-emitter";
class MyClass extends EventEmitter() {
// my class definition
}
const emitter = new MyClass();
emitter.on("event-name", function (data) {
console.log("called with", data.payload, "!");
});
emitter.emit("event-name", { payload: "foo" }); // logs "called with foo!"
const cb = function () {};
emitter.on("event-name", cb);
emitter.off("event-name", cb);
emitter.emit("event-name", { payload: "foo" }); // cb is not called
npm test
1.0.2
on
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.