shell-exec
Execute a command through the system shell
Table of Contents
Table of Contents
About
Install
Usage
API
Contribute
License
About
A tiny cross-platform promise based wrapper around child_process.spawn.
Install
$ npm install shell-exec
$ yarn add shell-exec
Usage
const shellExec = require('shell-exec')
shellExec('echo Hi!').then(console.log).catch(console.log)
API
shellExec(command, options)
Parameters:
command {String | Array} - String or Array of commands to run
options {Object} - Options object passed to child_process.spawn
The function then returns a Promise.
Contributing
Contributions are welcome!
- Fork it.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Or open up a issue.
License
Licensed under the MIT License.