
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
spawn-stack
Advanced tools
Spawn a new process using stack
command with the given arguments
const spawnStack = require('spawn-stack');
spawnStack(['--version']).then(result => {
result.output; //=> 'Version 1.4.0 x86_64\nCompiled with:\n ...'
});
Make sure stack
command is installed in your $PATH
, then install spawn-stack
via npm CLI.
npm install spawn-stack
const spawnStack = require('spawn-stack');
args: Array<String>
(command line arguments passed to stack
command)
options: Object
(execa
options, with preferLocal
defaulting to false
)
Return: ChildProcess
It returns the same value as execa
's:
a
child_process
instance, which is enhanced to also be aPromise
for a resultObject
withstdout
andstderr
properties.
On POSIX, --allow-different-user
flag will be automatically enabled to prevent file permission problems, unless --no-allow-different-user
flag is explicitly provided.
process.platform !== 'win32'; //=> true
spawnStack(['--numeric-version']).then(result => {
result.cmd; // 'stack --allow-different-user --numeric-version'
});
spawnStack(['--no-allow-different-user', '--numeric-version']).then(result => {
result.cmd; // 'stack --no-allow-different-user --numeric-version'
});
The return value also has Symbol.observable
method that returns a zen-observable instance passing each line of stderr
to its Subscription
. That means you can convert the return value into an Observable
by using Observable.from
.
const Observable = require('zen-observable');
const spawnStack = require('spawn-stack');
const cp = spawnStack(['setup', '8.0.2']);
Observable.from(cp).subscribe({
next(line) {
console.log(line);
// stack will use a sandboxed GHC it installed ...
},
complete() {
console.log('Done.')
}
});
Copyright (c) 2017 Shinnosuke Watanabe
Licensed under the MIT License.
FAQs
Spawn a new process using `stack` command with the given arguments
The npm package spawn-stack receives a total of 19 weekly downloads. As such, spawn-stack popularity was classified as not popular.
We found that spawn-stack 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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.