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.
mo-sequencer
Advanced tools
async
styleFunction inside sequencer
parsed as a string.
All function calls prefixed with ~~
and ~!
are executed first,
and substituted by resulting value. Prefix types are:
~~
for traditional callback(err, result)~!
for promisesPlease, copy comment when use sequencer, because ~~
and ~!
- it's new "coordinate system" which may confuse your colleagues.
var sequencer = require('mo-sequencer');
// (~˘▾˘)~ mo-sequencer: ~~ is call of async function; ~! is call of promise
sequencer((__o, __0) => { eval(__o)}, () => {
});
npm i mo-sequencer --save
or
bower i mo-sequencer --save
var someObject, someValue;
// (~˘▾˘)~ mo-sequencer: ~~ is call of async function; ~! is call of promise
sequencer((__o, __0) => { eval(__o)}, () => {
someValue = ~~asyncMultiplier(1);
someObject = {
value1: ~~asyncMultiplier(10),
value2: ~~asyncMultiplier(5)
};
console.log(someValue, someObject);
});
function asyncMultiplier(number, callback) {
setTimeout(function() {
callback(null, number * 2);
}, 1);
}
Let's see explanation of what happens on example, which we could have in real environment:
Download repo and check if example.js
looks cool in your favorite IDE.
git clone https://github.com/mojects/mo-sequencer.git
npm i
node example.js
Examples above work well on node and browser. Though there are list of limitations (see how to facilitate for their elimination) In current prototype following is not supported:
var
. (need to declare outside of sequencer, like in Usage example)As you can see - prototype has pretty limited abilities. Though it already simplifies async code a lot and looks like a great potential!
Do not hesitate to post your random thoughts in chat and contribute.
Maybe, here together with you we will build future of async programming! :) Like this dude:
FAQs
Allows to write inline async calls in js
We found that mo-sequencer 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’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.