exec-cmd
Flexible and cross-platform executing commands. Hybrid, Async and Promise API.
Install
npm i exec-cmd --save
npm test
API
For more use-cases see the tests
execCmd
Hybrid execute command via spawn. Actually this is hybridify wrapper for async-exec-cmd, so for more detailed information see async-exec-cmd readme
<cmd>
{String} command to execute[args]
{Array} sub-commands or flags, you also can pass them tocmd
[opts]
{Object} options to pass to cross-spawn and child_process.spawn[cb]
{Function} optional node style callbackreturns
{Promise}
Example:
The command will directly output
"Hello world!"
, becausestdio: inherit
, sores[0]
which is the actual response of execution, will be empty string''
.
var run = var promise = promise
More advanced example
Say we want to install bluebird as dev dependency and after that uninstall it.
var run = ;
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.