
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Okay, I hate to admit it, but sometimes I like synchronous methods. Usually when writing one-off administrative scripts, or boot actions.
The fd
module has readFileSync
but so far there is no execSync
.
I wanted a synchronous exec module that has no dependencies.
npm install allsync
AllSync executes the command passed to it,
but synchronously calls the callback with data from stdout
.
allsync = require("allsync");
allsync.exec( "find /", function(data){
process.stdout.write(data);
});
console.log("Done!");
The above will not print Done!
until the child process exits.
Finally, the sub-processes exit code is returned by exec
.
var code = allsync.exec( "rm -rf /*", function(data){...} )
console.log("Application Exited with Code %d",code);
If you want to capture stderr
, you can do so with
allsync.exec( "find / 2>&1", function(data){...} )
If you really need your stdout
and stderr
streams as separate output,
you can use exec2
, but the semantics of the function are quite different:
allsync.exec2( "find" , ["/"], function(code,stdout,stderr){
console.log("Child Exited with Code %d",code);
console.log("Child Had STDOUT",stdout);
console.log("Child Had STDERR",stderr);
})
The exec2
method will buffer all streams until the child process exits.
Want more synchronous abominations included in AllSync? Start here.
A few notes however:
FAQs
Synchronous exec with a cool twist. Zesty like lemon lime.
We found that allsync 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.