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.
A dispatcher to aid in following the Flux application architecture for applications that run in the server and the client
A Flux dispatcher for applications that run on the server and the client.
For a more detailed example, see our example application.
Let's start with a store that can handle the actions:
var util = require('util'),
EventEmitter = require('events').EventEmitter;
function ExampleStore(context) {
this.navigating = false;
}
util.inherits(ExampleStore, EventEmitter);
ExampleStore.handlers = {
'NAVIGATE': 'handleNavigate'
};
ExampleStore.prototype.handleNavigate = function () {
this.navigating = true;
this.emit('update'); // Store may be listening for updates to state
this.emit('final'); // Action has been fully handled
};
ExampleStore.prototype.getState = function () {
return {
navigating: this.navigating
};
};
Now let's initialize our dispatcher and dispatch an action:
var Dispatchr = require('dispatchr'),
ExampleStore = require('./example-store.js'),
context = {};
Dispatchr.registerStore(ExampleStore);
var dispatcher = new Dispatchr(context);
dispatcher.dispatch('NAVIGATE', {}, function () {
// Action has been handled fully
});
This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.
FAQs
A Flux dispatcher for applications that run on the server and the client.
The npm package dispatchr receives a total of 1,056 weekly downloads. As such, dispatchr popularity was classified as popular.
We found that dispatchr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.