Skip to content
Spawns a child process attached to parent's stdin, stdout and stderr. Inspired by PHP's passthru().
JavaScript Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

node-passthru

Spawns a child process attached to parent's stdin, stdout and stderr. Inspired by PHP's passthru().

Build Status

Usage

passthru(command, [options], [callback]);

For example, do an ls -la in the current directory:

var passthru = require('passthru');
passthru('ls -la', function(err) {
    // ...
});

You can also pass command as an array of strings. This is mandatory for arguments containing spaces and other special characters.

passthru(['ls', '-la'], function(err) {
    // ...
});

You can use any options supported by child_process.spawn:

passthru('ls -la', {cwd: '/tmp'}, function(err) {
    // ...
});
Something went wrong with that request. Please try again.