Socket
Book a DemoInstallSign in
Socket

exit-error

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exit-error

Maybe make an error from `ChildProcess`'s `exit` event parameters

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

exit-error

Maybe make an error from ChildProcess's exit event parameters.

Installation

npm install exit-error

Usage

var spawn = require('child_process').spawn
var ExitError = require('exit-error')

function rm(path, next) {
  var rm_ = spawn('rm', ['-rf', path])
  rm_.on('error', next)
  rm_.on('exit', function (code, signal) {
    next(ExitError('rm', code, signal))
  })
}

rm('foo', function (err) {
  if (err) throw err
})

Keywords

child process

FAQs

Package last updated on 10 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts