Skip to content

Instantly share code, notes, and snippets.



Last active Aug 8, 2018
What would you like to do?
Nodejs shell like programming: calling an external command and returning output to stdout
#! env node
// execFileSync will call the command directly without using a shell, a tad faster and prevents interpretation of characters
// ( similar to C and java exec )
const exec = require('child_process').execFileSync;
// inherit will use the stdio of the parent process, ie this nodejs script
exec('wget', ['', '--output-document', '/tmp/bla'], {stdio:'inherit'});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment