npm-run-all
npm-run-all copied to clipboard
Is it possible tun run system binaries?
{
"lol": "run-s 'echo 1'"
}
ERROR: Task not found: "echo"
Thank you for your question.
No. This is a tool to run multiple npm-scripts in series or parallel.
Therefore, run-s 'echo 1'
means "run 'echo' task with an argument 1
."
@mysticatea do we have something against supporting it? I can do the PR
npm-run-all isn't the place for this, but a separate tool to do it would be great.
A cross-platform way to run commands in parrallel.
A cross-platform way to run commands in parrallel.
concurrently is the standard in cross-platform parallel scripts running, and supports both npm and spawning, but, as the name suggests, doesn't support sequential execution, only parallel.
For anyone new to the package, the workaround seems to be to embed the command in a script:
{
"lol": "run-s 'cmd:echo 1'",
"cmd:echo": "echo"
}
Which produces the output:
↪ yarn lol
yarn run v1.22.4
$ run-s 'cmd:echo 1'
$ echo 1
1
Done in 0.43s.
@skubakdj I wouldn't call it a workaround. it's a feature.
and it comes down to making sure your code is testable.
ls -al ./ && cp -r /usr/local/logs/MYAPP.* ./ && rm -rf ./MYAPP-things* && aws a3 sync ./MYAPP-others* blah && echo "👍 done"
How would you test just the cp -r /usr/local/logs/MYAPP.*
without also polluting your test with the results of the rest of the above?
Having spent countless hours implementing CICD and local DX infrastructure I can tell you that this is certainly a feature.
My personal revulsion about having to implement extra npm/yarn tasks is that yarn or npm don't seem to want to support a yaml variant of the package.json file.
but at that point I'd really suggest you use something like :
- https://taskfile.dev/#/
- https://github.com/rliebz/tusk