Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
arch-orchestrator
Advanced tools
Orchestrator architectural pattern for large node.js applications
Managing architecture or big node.js applications can be challenging. With orchestrator approach you can improve structure of your node.js application by decoupling different tasks on system. Let's see typical architecture after moving to orchestrator approach.
Now let's clarify some parts of this architecture:
next
function in order to deliver
results to next part of task chain. Next step will have some another responsability, and so on, until end of chain.
When end of chain is reached, result will be available.So, central point of this system is orchestrator, and there is power of architecture this type. Orchestrator can decide to change order of actions in chain, can decide to add new steps to chain, can decide to remove some steps from chain, etc. All these actions should not hit any of tasks, because task don't know anything about who is sending data to task, or to who task is delivering data. That is completely dynamic.
Okey, let's look some practical example of this architecture, using arch-orchestrator
module.
First let's define few tasks.
function add(next, arg) {
return next(arg + 10);
}
function substract(next, arg) {
return next(arg - 10);
}
function multiply(next, arg) {
return next(arg * 10);
}
function divide(next, arg) {
return next(arg / 10);
}
Now we can define chain for out tasks. Orchestrator is responsable for that task.
var orchestrator = require('arch-orchestrator');
function doMagic() {
return orchestrator()
.setNext(add)
.setNext(multiply)
.setNext(substract)
.setNext(divide)
.end();
};
This chain is not very usefull, but it shows you idea of this approach. I belive you can see that you can easily remove/add/change order of tasks in chain, wihout hitting actual task.
And at the end some route handler should ask orchestrator for chain of methods.
function (req, res) {
var fn = doMagic();
console.log(fn(100));
}
MIT
FAQs
Orchestrator for large node.js applications
The npm package arch-orchestrator receives a total of 2 weekly downloads. As such, arch-orchestrator popularity was classified as not popular.
We found that arch-orchestrator 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.