0.8.3 • Published 4 years ago

@happyhackin/exec v0.8.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

@happyhackin/exec

Promisified exec, spawn, and execFile

Installation

  • Run npm i -S @happyhackin/exec

Usage

const {exec} require('@happyhackin/exec')

exec('ls /')
.then((success) => {
  // ... handle success
})
.catch((error) => {
  // ... handle error
})
const {spawn} require('@happyhackin/exec')

spawn('ls' ['/'])
.then((success) => {
  // ... handle success
})
.catch((error) => {
  // ... handle error
})
const {execFile} require('@happyhackin/exec')

execFile('/bin/ls' ['/'])
.then((success) => {
  // ... handle success
})
.catch((error) => {
  // ... handle error
})

Handling the result

  • resolves or rejects a ChildProcess along with the following annotations
  • resolved and rejected result data have same formatting
{
  ...ChildProcess,
  exitType: <string> -- close | dissconnect | error
  code: <number> |null
  signal: <string> | null
  error: <Error> | null
  failed: <boolean> 
  success: <boolean>
  stdout: <string> 
  stderr: <string>
  logged: <string> stdout + stderr in order of occurance
}
0.8.3

4 years ago

0.8.1

4 years ago

0.8.2

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.3.0

4 years ago

0.5.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago