benji.monster/node_modules/shell-exec
2020-01-03 21:48:09 +01:00
..
index.js upload site 2020-01-03 21:48:09 +01:00
LICENSE upload site 2020-01-03 21:48:09 +01:00
package.json upload site 2020-01-03 21:48:09 +01:00
README.md upload site 2020-01-03 21:48:09 +01:00

shell-exec

package version package downloads standard-readme compliant package license make a pull request Greenkeeper badge

A tiny cross-platform promise based wrapper around child_process.spawn.

Table of Contents

Install

This project uses node and npm.

$ npm install shell-exec
$ # OR
$ yarn add shell-exec

Usage

const shellExec = require('shell-exec')

shellExec('echo Hi!').then(console.log).catch(console.log)
// Hi!
// { stdout: '', stderr: '', cmd: 'echo Hi!', code: 0 }

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.

Contribute

  1. Fork it and create your feature branch: git checkout -b my-new-feature
  2. Commit your changes: git commit -am 'Add some feature' 3.Push to the branch: git push origin my-new-feature
  3. Submit a pull request

License

MIT