spawndamnit
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -7,3 +7,2 @@ // @flow | ||
const ChildProcessPromise = require('./promise'); | ||
const ChildProcessError = require('./error'); | ||
@@ -51,7 +50,3 @@ const activeProcesses = new Set(); | ||
activeProcesses.delete(child); | ||
if (code === 0) { | ||
resolve({ code, stdout, stderr }); | ||
} else { | ||
reject(new ChildProcessError({ code, stdout, stderr })); | ||
} | ||
resolve({ code, stdout, stderr }); | ||
}); | ||
@@ -63,2 +58,1 @@ }); | ||
module.exports.ChildProcessPromise = ChildProcessPromise; | ||
module.exports.ChildProcessError = ChildProcessError; |
{ | ||
"name": "spawndamnit", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "description": "Take care of your `spawn()`", |
@@ -26,12 +26,2 @@ # spawndamnit | ||
async function main() { | ||
await spawn('npm', ['star', 'spawndamnit']); | ||
} | ||
``` | ||
**With events and resolved values:** | ||
```js | ||
const spawn = require('spawndamnit'); | ||
async function main() { | ||
let child = spawn('npm', ['star', 'spawndamnit']); | ||
@@ -43,21 +33,5 @@ | ||
let { code, stdout, stderr } = await child; | ||
// ... | ||
} | ||
``` | ||
**With errors:** | ||
```js | ||
const spawn = require('spawndamnit'); | ||
async function main() { | ||
try { | ||
await spawn('npm', ['star', 'spawndamnit']); | ||
} catch (err) { | ||
if (err instanceof spawn.ChildProcessError) { | ||
let { code, stdout, stderr } = err; | ||
// ... | ||
} | ||
} | ||
console.log(code === 0 ? 'success' : 'error'); | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4457
6
61
36