{"_id":"comandante","_rev":"10-4b6975506cc1c11b12c9a69d1f34ab73","name":"comandante","description":"spawn() that returns a duplex stream and emits errors with stderr data on non-zero exit codes","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0":{"name":"comandante","version":"0.0.0","description":"spawn() that returns a duplex stream and emits errors with stderr data on non-zero exit codes","main":"index.js","bin":{},"directories":{"example":"example","test":"test"},"dependencies":{"duplexer":"~0.0.2"},"devDependencies":{"tap":"~0.3.0","through":"~1.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/comandante.git"},"homepage":"https://github.com/substack/comandante","keywords":["spawn","stream","duplex","stderr","exit","code","non-zero"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# commandante\n\nSpawn commands returning a duplex stream. Emit stderr when the command exits\nwith a non-zero code.\n\n[![build status](https://secure.travis-ci.org/substack/comandante.png)](http://travis-ci.org/substack/comandante)\n\n## example\n\n``` js\nvar run = require('commandante');\nrun('git', [ 'log' ]).pipe(process.stdout);\n```\n\nin a git directory we get:\n\n```\n$ node example/log.js | head -n3\ncommit ae5045cce4980a87b7151cfe91bc5889951aae39\nAuthor: James Halliday <mail@substack.net>\nDate:   Tue Oct 2 09:08:18 2012 -0700\n```\n\nin a non-git directory we get:\n\n```\nevents.js:66\n        throw arguments[1]; // Unhandled 'error' event\n                       ^\nError: non-zero exit code 128: fatal: Not a git repository (or any of the parent directories): .git\n\n    at ChildProcess.<anonymous> (/home/substack/projects/comandante/index.js:19:27)\n    at ChildProcess.EventEmitter.emit (events.js:91:17)\n    at maybeClose (child_process.js:634:16)\n    at Socket.ChildProcess.spawn.stdin (child_process.js:805:11)\n    at Socket.EventEmitter.emit (events.js:88:17)\n    at Socket._destroy.destroyed (net.js:358:10)\n    at process.startup.processNextTick.process._tickCallback (node.js:244:9)\n```\n\n# methods\n\n``` js\nvar commandante = require('commandante')\n```\n\n## commandante(cmd, args, opts={})\n\nSpawn a new process like `require('child_process')`.spawn()`, except the return\nvalue is a duplex stream combining `stdout` and `stdin`.\n\nIf the process exits with a non-zero status, emit an `'error'` event with the\nstderr data and the code in an informative message.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install comandante\n```\n\n# license\n\nMIT\n","_id":"comandante@0.0.0","dist":{"shasum":"1586b8387f92d15bdc74e179bd1791db30975137","tarball":"https://registry.npmjs.org/comandante/-/comandante-0.0.0.tgz","integrity":"sha512-Ah/OI5K9R5SCpli2noNJlBDltsPLMAgbfxJHd8Z7dEShhSMkOkivkS1qY+FHzJHb8v0KtCJctd28p0k8sV0U7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF2rhARLKJYCXlQkyya8xPGhxM2REGLIUWVz3jj+tj9gIhANAvDrfWOAC+wOgOHnCXT5aPWSr4cNxu/LGTdXr4kLlY"}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]},"0.0.1":{"name":"comandante","version":"0.0.1","description":"spawn() that returns a duplex stream and emits errors with stderr data on non-zero exit codes","main":"index.js","bin":{},"directories":{"example":"example","test":"test"},"dependencies":{"duplexer":"~0.0.2"},"devDependencies":{"tap":"~0.3.0","through":"~1.1.0"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/comandante.git"},"homepage":"https://github.com/substack/comandante","keywords":["spawn","stream","duplex","stderr","exit","code","non-zero"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readme":"# commandante\n\nSpawn commands returning a duplex stream. Emit stderr when the command exits\nwith a non-zero code.\n\n[![build status](https://secure.travis-ci.org/substack/comandante.png)](http://travis-ci.org/substack/comandante)\n\n## example\n\n``` js\nvar run = require('commandante');\nrun('git', [ 'log' ]).pipe(process.stdout);\n```\n\nin a git directory we get:\n\n```\n$ node example/log.js | head -n3\ncommit ae5045cce4980a87b7151cfe91bc5889951aae39\nAuthor: James Halliday <mail@substack.net>\nDate:   Tue Oct 2 09:08:18 2012 -0700\n```\n\nin a non-git directory we get:\n\n```\nevents.js:66\n        throw arguments[1]; // Unhandled 'error' event\n                       ^\nError: non-zero exit code 128: fatal: Not a git repository (or any of the parent directories): .git\n\n    at ChildProcess.<anonymous> (/home/substack/projects/comandante/index.js:19:27)\n    at ChildProcess.EventEmitter.emit (events.js:91:17)\n    at maybeClose (child_process.js:634:16)\n    at Socket.ChildProcess.spawn.stdin (child_process.js:805:11)\n    at Socket.EventEmitter.emit (events.js:88:17)\n    at Socket._destroy.destroyed (net.js:358:10)\n    at process.startup.processNextTick.process._tickCallback (node.js:244:9)\n```\n\n# methods\n\n``` js\nvar commandante = require('commandante')\n```\n\n## commandante(cmd, args, opts={})\n\nSpawn a new process like `require('child_process')`.spawn()`, except the return\nvalue is a duplex stream combining `stdout` and `stdin`.\n\nIf the process exits with a non-zero status, emit an `'error'` event with the\nstderr data and the code in an informative message.\n\nIf `opts.showCommand` is not `false`, show the actual command in the informative\nerror message. If you are running a command with passwords in the command\narguments make sure to set `showCommand` to `false`.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install comandante\n```\n\n# license\n\nMIT\n","_id":"comandante@0.0.1","dist":{"shasum":"8051da6082e87208aadd52bd817275b7c8035009","tarball":"https://registry.npmjs.org/comandante/-/comandante-0.0.1.tgz","integrity":"sha512-v+oHWculB8bDLaNKNnU296dvnpTdk38oQdryVD4KtwLB9i7RdYasi3t296PYxijereTBOMZHw2m/B54LCtlFxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOTRfvJCEhk1wRxZXrTllR8yIbpMR22UC0Ma+WQnz8VAiBSgfR2ctf0zS+Pn7PWD6kuMsUZ1DW4VmfNThSh5QHa6w=="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":"mail@substack.net"}]}},"readme":"# commandante\n\nSpawn commands returning a duplex stream. Emit stderr when the command exits\nwith a non-zero code.\n\n[![build status](https://secure.travis-ci.org/substack/comandante.png)](http://travis-ci.org/substack/comandante)\n\n## example\n\n``` js\nvar run = require('commandante');\nrun('git', [ 'log' ]).pipe(process.stdout);\n```\n\nin a git directory we get:\n\n```\n$ node example/log.js | head -n3\ncommit ae5045cce4980a87b7151cfe91bc5889951aae39\nAuthor: James Halliday <mail@substack.net>\nDate:   Tue Oct 2 09:08:18 2012 -0700\n```\n\nin a non-git directory we get:\n\n```\nevents.js:66\n        throw arguments[1]; // Unhandled 'error' event\n                       ^\nError: non-zero exit code 128: fatal: Not a git repository (or any of the parent directories): .git\n\n    at ChildProcess.<anonymous> (/home/substack/projects/comandante/index.js:19:27)\n    at ChildProcess.EventEmitter.emit (events.js:91:17)\n    at maybeClose (child_process.js:634:16)\n    at Socket.ChildProcess.spawn.stdin (child_process.js:805:11)\n    at Socket.EventEmitter.emit (events.js:88:17)\n    at Socket._destroy.destroyed (net.js:358:10)\n    at process.startup.processNextTick.process._tickCallback (node.js:244:9)\n```\n\n# methods\n\n``` js\nvar commandante = require('commandante')\n```\n\n## commandante(cmd, args, opts={})\n\nSpawn a new process like `require('child_process')`.spawn()`, except the return\nvalue is a duplex stream combining `stdout` and `stdin`.\n\nIf the process exits with a non-zero status, emit an `'error'` event with the\nstderr data and the code in an informative message.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install comandante\n```\n\n# license\n\nMIT\n","maintainers":[{"email":"nopersonsmodules@gmail.com","name":"nopersonsmodules"}],"time":{"modified":"2022-11-11T06:34:01.875Z","created":"2012-10-02T20:58:32.796Z","0.0.0":"2012-10-02T20:58:34.535Z","0.0.1":"2012-10-04T09:02:07.785Z"},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/comandante.git"},"users":{"bret":true}}