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.
Executes shell commands synchronously.
WARNING For dev machine shell scripting only. DO NOT USE for production servers.
Windows requires Python and Visual Studio 2012 (Express) installed for node to build. See node-gyp installation. Pre-built binaries for node v0.8 and node v0.10 are packaged. They should work and if not try manually building.
npm install execSync
Sometimes a manual build is necessary on Windows even with all the tools in place, replace Visual Studio version with '2010' or '2012' based on the version installed.
npm install node-gyp -g
node-gyp rebuild --msvs_version=2012
Require it
var sh = require('execSync');
Run
does not capture output.
var code = sh.run('echo $USER; echo some_err 1>&2; exit 1');
console.log('return code ' + code);
Use the less efficient exec
if you need output. exec
is just redirection
trickery around run
.
var result = sh.exec('echo $USER; echo some_err 1>&2; exit 1');
console.log('return code ' + result.code);
console.log('stdout + stderr ' + result.stdout);
In *nix and OSX version commands are run via sh -c YOUR_COMMAND
In Windows commands are run via cmd /C YOUR_COMMAND
Copyright (c) 2012, 2013 Mario Gutierrez mario@mgutz.com
See the file LICENSE for copying permission.
FAQs
Node's missing execSync.
The npm package execSync receives a total of 3,516 weekly downloads. As such, execSync popularity was classified as popular.
We found that execSync 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.