Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
ngraph.events
Advanced tools
Small and powerful eventing in node and browser
var eventify = require('ngraph.events');
var yourObject = {}; // any javascript object
eventify(yourObject);
// now any object can listen to events from your object
yourObject.on('beep', function(name) { console.log('Hello ' + name); });
// and you can fire events from your object:
yourObject.fire('beep', 'World!'); // prints 'Hello World!'
// stop listen to events:
yourObject.off('beep');
More advanced examples:
var eventify = require('ngraph.events');
var yourObject = eventify({});
// Pass context to event handler as last argument:
yourObject.on('beep', function () { console.log(this === yourObject); }, yourObject);
yourObject.fire('beep'); // prints true;
// Pass additional arguments to fire:
var onBop = function (x, y) { console.log(x + y); };
yourObject.on('bop', onBop);
yourObject.fire('bop', 40, 2); // prints 42;
// Remove given event handler for 'bop' event
yourObject.off('bop', onBop);
// Remove all event listeners from your object:
yourObject.off();
I wanted a light-weight eventing library, so I built this.
With npm do:
npm install ngraph.events
BSD 3-Clause
FAQs
Basic events supoort for ngraph.js
The npm package ngraph.events receives a total of 70,692 weekly downloads. As such, ngraph.events popularity was classified as popular.
We found that ngraph.events 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
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.